Skip to content

Commit 1ad6fff

Browse files
authored
Merge pull request #89 from Volga/urlencode-patch
URL-encoding values of URL-query variables
2 parents 6c4816d + 96f0fec commit 1ad6fff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Types/HttpQuery.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ public static function createConditionals(array $tokens) {
7070

7171
// Get WHERE conditions as string including table alias and primary key column if present
7272
$sqlWhereString = array_reduce($tokens['WHERE'], function($query, $token) use ($tableAlias) {
73-
return $query . str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr'])));
73+
$baseExpr = str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr'])));
74+
75+
return $query . ($token['expr_type'] == 'const' ? urlencode($baseExpr) : $baseExpr);
7476
});
7577

7678
// Remove primary key column before removing table alias and returning

0 commit comments

Comments
 (0)