diff --git a/Types/HttpQuery.php b/Types/HttpQuery.php index bcfe54a..92b2a01 100644 --- a/Types/HttpQuery.php +++ b/Types/HttpQuery.php @@ -70,7 +70,9 @@ public static function createConditionals(array $tokens) { // Get WHERE conditions as string including table alias and primary key column if present $sqlWhereString = array_reduce($tokens['WHERE'], function($query, $token) use ($tableAlias) { - return $query . str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr']))); + $baseExpr = str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr']))); + + return $query . ($token['expr_type'] == 'const' ? urlencode($baseExpr) : $baseExpr); }); // Remove primary key column before removing table alias and returning