From 411d198d0d10284ca4d0427308fbd244e1473e29 Mon Sep 17 00:00:00 2001 From: beerwine Date: Mon, 19 Jan 2015 09:38:10 +0100 Subject: [PATCH] Added support for ILIKE in pgsql. --- adminer/drivers/pgsql.inc.php | 2 +- adminer/include/adminer.inc.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 7e0d629a..f8c51be8 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -649,7 +649,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 "SQL" to avoid SQL injection + $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "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( diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index fb4bbd72..4ef6ab44 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -429,6 +429,8 @@ username.form['auth[driver]'].onchange(); $cond = " $val[val]"; // SQL injection } elseif ($val["op"] == "LIKE %%") { $cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%"); + } elseif ($val["op"] == "ILIKE %%") { + $cond = " ILIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%"); } elseif (!preg_match('~NULL$~', $val["op"])) { $cond .= " " . $this->processInput($fields[$val["col"]], $val["val"]); }