From 83e8bac50312db8dfe282e47df04196d34152f47 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Fri, 25 Sep 2009 13:48:00 +0000 Subject: [PATCH] Search operators git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1148 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- changes.txt | 1 + editor/include/adminer.inc.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index 1bffc86d..46c0d654 100644 --- a/changes.txt +++ b/changes.txt @@ -5,6 +5,7 @@ Display whitespace in texts (bug #2858042) Display number of manipulated rows in JS confirm E-mail attachments (Editor) Optional year in date (Editor) +Search operators (Editor) Move

to $adminer->navigation (customization) Rename get_dbh to connection (customization) diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 3bbf8075..e67edff3 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -1,5 +1,6 @@ ="); function name() { return lang('Editor'); @@ -167,11 +168,13 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 foreach ((array) $_GET["where"] as $val) { if (strlen("$val[col]$val[val]")) { echo "
"; + echo ""; echo "
\n"; $i++; } } echo "
"; + echo ""; echo "
\n"; echo "\n"; } @@ -238,7 +241,7 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 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"])); - $conds[] = idf_escape($name) . ($value == "NULL" ? " IS" : ($val["op"] != "=" && $text_type ? " LIKE" : " =")) . " $value"; + $conds[] = idf_escape($name) . (in_array($val["op"], $this->operators) ? " $val[op]" : ($value == "NULL" ? " IS" : ($val["op"] != "=" && $text_type ? " LIKE" : " ="))) . " $value"; } } $return[] = ($conds ? "(" . implode(" OR ", $conds) . ")" : "0");