Skip to content

Commit

Permalink
Respect function results in where()
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@441 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Aug 8, 2008
1 parent 9ea3112 commit 581bd35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions functions.inc.php
Expand Up @@ -141,10 +141,12 @@ function where($where) {
global $mysql;
$return = array();
foreach ((array) $where["where"] as $key => $val) {
$return[] = idf_escape(bracket_escape($key, "back")) . " = BINARY '" . $mysql->escape_string($val) . "'"; //! enum and set
$key = bracket_escape($key, "back");
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]+|``)+`\\)$~', $key) ? $key : idf_escape($key)) . " = BINARY '" . $mysql->escape_string($val) . "'"; //! enum and set, columns looking like functions
}
foreach ((array) $where["null"] as $key) {
$return[] = idf_escape(bracket_escape($key, "back")) . " IS NULL";
$key = bracket_escape($key, "back");
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]+|``)+`\\)$~', $key) ? $key : idf_escape($key)) . " IS NULL";
}
return $return;
}
Expand Down

0 comments on commit 581bd35

Please sign in to comment.