mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 585869 - Check for file scheme in nsResURL::EnsureFile, r=bsmedberg a=blocking2.0
This commit is contained in:
parent
76ee88c5a6
commit
94d6ae2889
@ -95,25 +95,20 @@ nsResURL::EnsureFile()
|
||||
|
||||
nsCAutoString spec;
|
||||
rv = gResHandler->ResolveURI(this, spec);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#if defined(MOZ_CHROME_FILE_FORMAT_JAR) || defined(MOZ_OMNIJAR)
|
||||
nsCAutoString host;
|
||||
rv = GetHost(host);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// Deal with the fact resource://gre-resouces/ urls do not resolve to files
|
||||
if (host.Equals(kGRE_RESOURCES))
|
||||
|
||||
nsCAutoString scheme;
|
||||
rv = net_ExtractURLScheme(spec, nsnull, nsnull, &scheme);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// Bug 585869:
|
||||
// In most cases, the scheme is jar if it's not file.
|
||||
// Regardless, net_GetFileFromURLSpec should be avoided
|
||||
// when the scheme isn't file.
|
||||
if (!scheme.Equals(NS_LITERAL_CSTRING("file")))
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
#endif
|
||||
#ifdef MOZ_OMNIJAR
|
||||
if (mozilla::OmnijarPath()) {
|
||||
if (host.Equals(kGRE))
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
if (host.IsEmpty())
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
#endif
|
||||
|
||||
rv = net_GetFileFromURLSpec(spec, getter_AddRefs(mFile));
|
||||
#ifdef DEBUG_bsmedberg
|
||||
|
Loading…
Reference in New Issue
Block a user