]> git.joonet.de Git - adminer.git/commitdiff
Avoid % with operator in Editor (forum 4090988)
authorJakub Vrana <jakub@vrana.cz>
Sun, 6 Feb 2011 11:42:24 +0000 (12:42 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 6 Feb 2011 11:42:24 +0000 (12:42 +0100)
editor/include/adminer.inc.php

index 3a587302c9a4dddce1391e096928f7a9662626b0..d5fc28c6a8b2b5218f66133cd1724760ea887465 100644 (file)
@@ -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"