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

Editor: Allow disabling boolean fields in PostgreSQL (bug #640)

This commit is contained in:
Jakub Vrana
2019-01-22 12:04:08 +01:00
parent 659003e07f
commit 7defb7787d
2 changed files with 3 additions and 2 deletions

View File

@@ -485,7 +485,7 @@ qsl('div').onclick = whisperClick;", "")
);
}
if (like_bool($field)) {
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? ' checked' : '') . "$attrs>";
return '<input type="checkbox" value="1"' . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? ' checked' : '') . "$attrs>";
}
$hint = "";
if (preg_match('~time~', $field["type"])) {
@@ -517,7 +517,7 @@ qsl('div').onclick = whisperClick;", "")
}
$return = ($field["type"] == "bit" && preg_match('~^[0-9]+$~', $value) ? $return : q($return));
if ($value == "" && like_bool($field)) {
$return = "0";
$return = "'0'";
} elseif ($value == "" && ($field["null"] || !preg_match('~char|text~', $field["type"]))) {
$return = "NULL";
} elseif (preg_match('~^(md5|sha1)$~', $function)) {