From: Jakub Vrana Date: Thu, 13 Mar 2025 15:55:17 +0000 (+0100) Subject: Don't highlight NULL as JSON X-Git-Tag: v5.0.5~8 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=45107dc46e7bf58f860a15ce3f49f0f0fa52d331;p=adminer.git Don't highlight NULL as JSON --- diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index b320d4ec..02e634c1 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -289,13 +289,14 @@ class Adminer { * @return string */ function selectVal($val, $link, $field, $original) { - $return = ($val === null ? "NULL" : (preg_match("~char|binary|boolean~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "$val" : $val)); + $return = ($val === null ? "NULL" + : (preg_match("~char|binary|boolean~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "$val" + : (preg_match('~json~', $field["type"]) ? "$val" + : $val) + )); if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) { $return = "" . lang('%d byte(s)', strlen($original)) . ""; } - if (preg_match('~json~', $field["type"])) { - $return = "$return"; - } return ($link ? "$return" : $return); }