public function procShopFilter() { if (!$goto = Context::get('goto') ? Context::get('goto') : $_SERVER['HTTP_REFERER']) { throw new ShopException('Nowhere to go back to'); } if (isset($_GET['filter']) && is_array($filters = $_GET['filter'])) { /** * Context::get doesn't seem to work for arrays (such as filter) * so we must perform strict input checks to avoid injections. */ $goto = FrontFilters::redirectUrl($goto, $filters); } $this->setRedirectUrl($goto); }