зеркало из https://github.com/mozilla/pjs.git
Fix bug 624764. r=bsmedberg, a=betaN+
This commit is contained in:
Родитель
7a5c9f3bbd
Коммит
e9da318550
|
@ -467,10 +467,6 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result)
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
|
||||
if (!url)
|
||||
return NS_NOINTERFACE;
|
||||
|
||||
nsCAutoString host;
|
||||
nsCAutoString path;
|
||||
|
||||
|
@ -480,15 +476,15 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result)
|
|||
rv = uri->GetPath(path);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCAutoString filepath;
|
||||
url->GetFilePath(filepath);
|
||||
// Unescape the path so we can perform some checks on it.
|
||||
nsCAutoString unescapedPath(path);
|
||||
NS_UnescapeURL(unescapedPath);
|
||||
|
||||
// Don't misinterpret the filepath as an absolute URI.
|
||||
if (filepath.FindChar(':') != -1)
|
||||
if (unescapedPath.FindChar(':') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
NS_UnescapeURL(filepath);
|
||||
if (filepath.FindChar('\\') != -1)
|
||||
if (unescapedPath.FindChar('\\') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
const char *p = path.get() + 1; // path always starts with a slash
|
||||
|
|
Загрузка…
Ссылка в новой задаче