Editor: Do not check boolean checkboxes with false in PostgreSQL (bug #607)

This commit is contained in:
Jakub Vrana 2018-05-06 11:26:43 +02:00
parent 60d1b7b3b4
commit 5c3fb875e1
2 changed files with 2 additions and 1 deletions

View file

@ -9,6 +9,7 @@ MySQL: Use CONVERT() only when searching for non-ASCII (bug #603)
PostgreSQL: Add SQL operator to search
PostgreSQL: Fix editing data in views (bug #605, regression from 4.6.0)
PostgreSQL: Do not cast date/time/number searches to text
Editor: Do not check boolean checkboxes with false in PostgreSQL (bug #607)
Adminer 4.6.2 (released 2018-02-20):
Semi-transparent border on table actions

View file

@ -485,7 +485,7 @@ qsl('div').onclick = whisperClick;", "")
);
}
if (like_bool($field)) {
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . ($value ? ' checked' : '') . "$attrs>";
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? ' checked' : '') . "$attrs>";
}
$hint = "";
if (preg_match('~time~', $field["type"])) {