Skip to content

Commit

Permalink
Added support for ILIKE in pgsql.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmecera authored and vrana committed Feb 7, 2015
1 parent 060c006 commit 411d198
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion adminer/drivers/pgsql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ function support($feature) {
$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(
Expand Down
2 changes: 2 additions & 0 deletions adminer/include/adminer.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ function selectSearchProcess($fields, $indexes) {
$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"]);
}
Expand Down

0 comments on commit 411d198

Please sign in to comment.