1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Link routines from syntax highlighting

This commit is contained in:
Jakub Vrana
2025-07-07 15:01:46 +02:00
parent 9424b7431e
commit c9a52cd28c
4 changed files with 13 additions and 4 deletions

View File

@@ -150,13 +150,13 @@ function select_input(string $attrs, array $options, ?string $value = "", string
* @param string $key or "" to close the object
* @param string|int $val
*/
function json_row(string $key, $val = null): void {
function json_row(string $key, $val = null, bool $escape = true): void {
static $first = true;
if ($first) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null');
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? ($escape ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : $val) : 'null');
$first = false;
} else {
echo "\n}\n";