public static function removeQueryString($path)
    {
        if (false === $pos = strpos($path, '?')) {
            return $path;
        }

        $anchorPos = strpos($path, '#', $pos);

        $end = false === $anchorPos ? strlen($path) : $anchorPos;

        return substr($path, 0, $pos).substr($path, $end);
    }