]> git.joonet.de Git - adminer.git/commitdiff
Skip date columns for non-date values in search anywhere (thanks to PR #408)
authorJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 09:53:20 +0000 (10:53 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 09:53:20 +0000 (10:53 +0100)
adminer/include/adminer.inc.php
changes.txt

index add257d3043e060d40d81db467e0135f5db5a614..d931e07d156082f5ce9077cd2a55e4751e9ab62f 100644 (file)
@@ -563,6 +563,7 @@ class Adminer {
                                        foreach ($fields as $name => $field) {
                                                if ((preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
                                                        && (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
+                                                       && (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
                                                ) {
                                                        $cols[] = $prefix . $driver->convertSearch(idf_escape($name), $val, $field) . $cond;
                                                }
index e7f512326e3a665e1c4bcf17e2d6bb5708329dcc..dbe8836ee0af5a8012f6dda2ddef9fdd5f90e244 100644 (file)
@@ -1,4 +1,5 @@
 Adminer 4.7.10-dev:
+Skip date columns for non-date values in search anywhere
 Add DB version to comment in export
 Support PHP 8 in create table (regression from 4.7.9)