protected function detectPathInfo()
    {
        $uri = $this->getRequestUri();

        $pathInfo = '/' . trim(substr($uri, strlen($this->getBaseUrl())), '/');

        if (false !== $pos = strpos($pathInfo, '?')) {
            $pathInfo = substr($pathInfo, 0, $pos);
        }
        return $pathInfo;
    }