]> git.joonet.de Git - adminer.git/commitdiff
Rename empty select operator to SQL
authorJakub Vrana <jakub@vrana.cz>
Fri, 26 Apr 2013 19:04:28 +0000 (12:04 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 26 Apr 2013 19:20:17 +0000 (12:20 -0700)
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/include/adminer.inc.php
adminer/include/pdo.inc.php

index c39e866896220bab49755a8a25b074c844402230..493eee4dfdece633d781e27956d0cbbe30ebd5d9 100644 (file)
@@ -1004,7 +1004,7 @@ if (!defined("DRIVER")) {
                $structured_types[$key] = array_keys($val);
        }
        $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); ///< @var array operators used in select
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); ///< @var array operators used in select
        $functions = array("char_length", "date", "from_unixtime", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
        $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
        $edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
index 85f0089c397a68ee630d3132f7845df3e05b3d5e..ecfdfae9e9246d402122277eba2e23c6fe7cfb30 100644 (file)
@@ -386,7 +386,7 @@ ORDER BY PROCESS
                $structured_types[$key] = array_keys($val);
        }
        $unsigned = array();
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "");
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
        $functions = array("length", "lower", "round", "upper");
        $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
        $edit_functions = array(
index 150c6470892e56692a6cea2a737a260f89153d48..e123311d1d0e5d72c60cd9ac9c0c53da27ea547a 100644 (file)
@@ -607,7 +607,7 @@ AND typelem = 0"
                $structured_types[$key] = array_keys($val);
        }
        $unsigned = array();
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "" to avoid SQL injection
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid SQL injection
        $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
        $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
        $edit_functions = array(
index f6ac0e1e249a06a160acdddb13db0a7b5e40db61..b99bc2f78364e999e2afa90d53855ed65c7fa4da 100644 (file)
@@ -674,7 +674,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
        $types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
        $structured_types = array_keys($types);
        $unsigned = array();
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", ""); // REGEXP can be user defined function
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
        $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
        $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
        $edit_functions = array(
index afc2b04980b04636f6c720a4e517613f63170f21..83a7aa92d2aeba1c460b5ff7be324e3d13b37138 100644 (file)
@@ -400,8 +400,8 @@ username.form['auth[driver]'].onchange();
                                if (ereg('IN$', $val["op"])) {
                                        $in = process_length($val["val"]);
                                        $cond .= " (" . ($in != "" ? $in : "NULL") . ")";
-                               } elseif (!$val["op"]) {
-                                       $cond .= $val["val"]; // SQL injection
+                               } elseif ($val["op"] == "SQL") {
+                                       $cond = " $val[val]"; // SQL injection
                                } elseif ($val["op"] == "LIKE %%") {
                                        $cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
                                } elseif (!ereg('NULL$', $val["op"])) {
index 47d26a36218734d171a0f4404bfa1342c711dc7a..ee2e8396f28884c65b6d3149c05349a12ec10933 100644 (file)
@@ -6,7 +6,7 @@ if (extension_loaded('pdo')) {
                
                function __construct() {
                        global $adminer;
-                       $pos = array_search("", $adminer->operators);
+                       $pos = array_search("SQL", $adminer->operators);
                        if ($pos !== false) {
                                unset($adminer->operators[$pos]);
                        }