protected function chompLogin(&$url)
    {
        $prefix = '';
        if (preg_match('#^(//)(.*)#', $url, $matches)) {
            $prefix = $matches[1];
            $url    = $matches[2];
        }
        if (preg_match('#^([^/]*)@(.*)#', $url, $matches)) {
            $url   = $prefix . $matches[2];
            $parts = explode(':', $matches[1]);

            return array(
                    urldecode($parts[0]),
                    isset($parts[1]) ? urldecode($parts[1]) : false);
        }
        $url = $prefix . $url;

        return array(false, false);
    }
protected function chompLogin(&$url)
    {
        $prefix = '';
        if (preg_match('#^(//)(.*)#', $url, $matches)) {
            $prefix = $matches[1];
            $url    = $matches[2];
        }
        if (preg_match('#^([^/]*)@(.*)#', $url, $matches)) {
            $url   = $prefix . $matches[2];
            $parts = explode(':', $matches[1]);

            return array(
                    urldecode($parts[0]),
                    isset($parts[1]) ? urldecode($parts[1]) : false);
        }
        $url = $prefix . $url;

        return array(false, false);
    }
Extracts the username and password from the incoming URL. The // prefix will be reattached to
the URL after the doublet is extracted.

@param string $url    URL so far. The username and password are removed.

@return array         Two item list of username and password. Will urldecode() them.