Skip to content

Commit

Permalink
Merge pull request #89 from Volga/urlencode-patch
Browse files Browse the repository at this point in the history
URL-encoding values of URL-query variables
  • Loading branch information
TobiasHauck authored Jul 12, 2019
2 parents 6c4816d + 96f0fec commit 1ad6fff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Types/HttpQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ad6fff

Please sign in to comment.