From 99b980ab60688d1b9740ce6172edfc557bf900f1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 6 Feb 2011 12:42:24 +0100 Subject: [PATCH] Avoid % with operator in Editor (forum 4090988) --- editor/include/adminer.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 3a587302..d5fc28c6 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -298,7 +298,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 $conds[] = (in_array(0, $val) ? idf_escape($name) . " IS NULL OR " : "") . idf_escape($name) . " IN (" . implode(", ", array_map('intval', $val)) . ")"; } else { $text_type = ereg('char|text|enum|set', $field["type"]); - $value = $this->processInput($field, ($text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val)); + $value = $this->processInput($field, (!$op && $text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val)); $conds[] = idf_escape($name) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value" : (in_array($op, $this->operators) || $op == "=" ? " $op $value" : ($text_type ? " LIKE $value"