Skip date columns for non-date values in search anywhere (thanks to PR #408)

This commit is contained in:
Jakub Vrana 2021-02-08 10:53:20 +01:00
parent 28209301ca
commit 2dd3bd0e1a
2 changed files with 2 additions and 0 deletions

View 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;
}

View 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)