From 097364488174ad029d4ef0bffd005af5c13b3616 Mon Sep 17 00:00:00 2001 From: Jordy Moos Date: Mon, 30 Nov 2015 12:17:21 +0100 Subject: [PATCH] Hide underscores parameters from the url. Underscored variables should 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. --- Subscriber/SlidingPaginationSubscriber.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Subscriber/SlidingPaginationSubscriber.php b/Subscriber/SlidingPaginationSubscriber.php index b0cb5599..1458a85a 100755 --- a/Subscriber/SlidingPaginationSubscriber.php +++ b/Subscriber/SlidingPaginationSubscriber.php @@ -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)