]> git.joonet.de Git - adminer.git/commitdiff
Editor: Do not check boolean checkboxes with false in PostgreSQL (bug #607)
authorJakub Vrana <jakub@vrana.cz>
Sun, 6 May 2018 09:26:43 +0000 (11:26 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 6 May 2018 09:26:43 +0000 (11:26 +0200)
changes.txt
editor/include/adminer.inc.php

index 2b0dd3e6c8b6541e322a879bda5f5adc1cd8a8b4..ed129e7bbe464eb2a5e1d4b3da1e9daab0d4e398 100644 (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
index 316c863555659f0848b32279c57718e50dab674c..04ffca2662a4939e03df819f1f102a6fa95a4a23 100644 (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"])) {