Skip to content

Commit fa63fb0

Browse files
committed
Issue #19: Allow the left side to be a bound variable when casting fields for ILIKE and LIKE conditions.
1 parent 6dd27f5 commit fa63fb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

database.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
8989
// @todo This workaround only affects bytea fields, but the involved field
9090
// types involved in the query are unknown, so there is no way to
9191
// conditionally execute this for affected queries only.
92-
$query = stripos($query, 'where') ? preg_replace('/\b([^ ]+(\(.*\))?) +(I*LIKE|NOT +I*LIKE) /iU', ' ${1}::text ${3} ', $query) : $query;
92+
$query = stripos($query, 'where') ? preg_replace('/\b:?([^ ]+(\(.*\))?) +(I*LIKE|NOT +I*LIKE) /iU', '${1}::text ${3} ', $query) : $query;
9393
return parent::prepareQuery($query);
9494
}
9595

0 commit comments

Comments
 (0)