Skip to content

Commit 812f6ad

Browse files
committed
Escape control-characters in generated swagger
When some table's description has `control-characters`, likes `\t` `\n`, swagger that generated by `/api.php` is a defective json
1 parent ef4322b commit 812f6ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2367,7 +2367,7 @@ protected function swagger($settings) {
23672367
if ($i>0) echo ',';
23682368
echo '{';
23692369
echo '"name":"'.$table['name'].'",';
2370-
echo '"description":"'.$table['comments'].'"';
2370+
echo '"description":'.json_encode($table['comments']);
23712371
echo '}';
23722372
}
23732373
echo '],';

0 commit comments

Comments
 (0)