1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 03:24:01 +02:00

Simplify work with NULL values in select

This commit is contained in:
Jakub Vrana
2012-05-13 23:24:39 -07:00
parent 20cf6d29c5
commit c4a57246ac
4 changed files with 11 additions and 10 deletions

View File

@@ -184,9 +184,9 @@ username.form['driver'].onchange();
* @return string
*/
function selectVal($val, $link, $field) {
$return = ($val != "<i>NULL</i>" && ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val);
$return = ($val === null ? "<i>NULL</i>" : (ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val));
if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen(html_entity_decode($val, ENT_QUOTES)));
$return = lang('%d byte(s)', strlen($val));
}
return ($link ? "<a href='$link'>$return</a>" : $return);
}