private function _checkUrl($url) { if (empty($url)) { return Url::redirect(Url::getRoot('public')); } return filter_var($url, FILTER_SANITIZE_URL); }
<?php /* * Public errors handling */ use WebSupportDK\PHPHttp\Url; switch (Url::getError()) { case 404: Url::redirect(Url::getRoot('public') . 'error/code/404'); break; case 42: Url::redirect(Url::getRoot('public') . 'error/code/42'); break; default: break; }