protected function chompPath(&$url)
    {
        if (preg_match('/(.*?)(\?|#|$)(.*)/', $url, $matches)) {
            $url = $matches[2] . $matches[3];

            return ($matches[1] ? $matches[1] : '');
        }

        return '';
    }