Browse Source

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
q 7 years ago
parent
commit
812f6ad591
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      api.php

+ 1
- 1
api.php View File

@@ -2367,7 +2367,7 @@ class PHP_CRUD_API {
2367 2367
 			if ($i>0) echo ',';
2368 2368
 			echo '{';
2369 2369
 			echo '"name":"'.$table['name'].'",';
2370
-			echo '"description":"'.$table['comments'].'"';
2370
+			echo '"description":'.json_encode($table['comments']);
2371 2371
 			echo '}';
2372 2372
 		}
2373 2373
 		echo '],';

Loading…
Cancel
Save