From 2dd3bd0e1aff4f096f6ad57f3f59b66d11397d1a Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 8 Feb 2021 10:53:20 +0100 Subject: [PATCH] Skip date columns for non-date values in search anywhere (thanks to PR #408) --- adminer/include/adminer.inc.php | 1 + changes.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index add257d3..d931e07d 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -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; } diff --git a/changes.txt b/changes.txt index e7f51232..dbe8836e 100644 --- a/changes.txt +++ b/changes.txt @@ -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)