Skip to content

Commit

Permalink
Update HttpQuery.php
Browse files Browse the repository at this point in the history
coding style
  • Loading branch information
TobiasHauck authored Jul 12, 2019
1 parent 260c1d3 commit 96f0fec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Types/HttpQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +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) {

$baseExpr = str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr'])));

if ($token['expr_type'] == 'const') {
$baseExpr = urlencode($baseExpr);
}

return $query . $baseExpr;
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 96f0fec

Please sign in to comment.