Skip to content

Commit

Permalink
Removed escape filter because we don't use that in Rackbeat API
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Mar 19, 2019
1 parent 085c963 commit d9bedc5
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions src/Builders/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function parseFilters( $filters = [] )

foreach ( $filters as $filter ) {

$urlFilters .= $filter[ 0 ] . $filter[ 1 ] . $this->escapeFilter( $filter[ 2 ] ?? '=' );
$urlFilters .= $filter[ 0 ] . $filter[ 1 ] . $filter[ 2 ] ?? '=';

if ( count( $filters ) > $i ) {

Expand All @@ -86,33 +86,6 @@ protected function parseFilters( $filters = [] )
return $urlFilters;
}

private function escapeFilter( $variable )
{
$escapedStrings = [
"$",
'(',
')',
'*',
'[',
']',
',',
];
$urlencodedStrings = [
'+',
' ',
];
foreach ( $escapedStrings as $escapedString ) {

$variable = str_replace( $escapedString, '$' . $escapedString, $variable );
}
foreach ( $urlencodedStrings as $urlencodedString ) {

$variable = str_replace( $urlencodedString, urlencode( $urlencodedString ), $variable );
}

return $variable;
}

public function all( $filters = [] )
{
$page = 1;
Expand Down

0 comments on commit d9bedc5

Please sign in to comment.