]> git.joonet.de Git - adminer.git/commitdiff
Simplify LIKE detection
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 2 Oct 2009 19:51:33 +0000 (19:51 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 2 Oct 2009 19:51:33 +0000 (19:51 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1164 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editor/include/adminer.inc.php

index 9160de1eac15be252e60bb59ed9b45f3c451eb78..07a98ce7419c148a1f434278826123f624de9444 100644 (file)
@@ -246,7 +246,7 @@ ORDER BY ORDINAL_POSITION");
                                foreach ((strlen($col) ? array($col => $fields[$col]) : $fields) as $name => $field) {
                                        if (strlen($col) || is_numeric($val["val"]) || !ereg('int|float|double|decimal', $field["type"])) {
                                                $text_type = ereg('char|text|enum|set', $field["type"]);
-                                               $value = $this->processInput($field, (strlen($val["val"]) && $text_type && strpos($val["val"], "%") === false ? "%$val[val]%" : $val["val"]));
+                                               $value = $this->processInput($field, ($text_type && ereg('^[^%]+$', $val["val"]) ? "%$val[val]%" : $val["val"]));
                                                $conds[] = idf_escape($name) . (in_array($val["op"], $this->operators) ? " $val[op]" : ($value == "NULL" ? " IS" : ($val["op"] != "=" && $text_type ? " LIKE" : " ="))) . " $value";
                                        }
                                }