Skip to content

Commit

Permalink
Hide underscores parameters from the url. Underscored variables shoul…
Browse files Browse the repository at this point in the history
…d not be in the url and they will messup the esi esi includes. For example the _hash in the esi include will be put into the links in the paginator. Which obviously is wrong.
  • Loading branch information
Jordy Moos committed Nov 30, 2015
1 parent 5147740 commit 0973644
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Subscriber/SlidingPaginationSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function onKernelRequest(GetResponseEvent $event)

$this->route = $request->attributes->get('_route');
$this->params = array_merge($request->query->all(), $request->attributes->get('_route_params', array()));
foreach ($this->params as $key => $param) {
if (substr($key, 0, 1) == '_') {
unset($this->params[$key]);
}
}
}

public function pagination(PaginationEvent $event)
Expand Down

0 comments on commit 0973644

Please sign in to comment.