mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Ignore empty uri strings during persistence. b=166269 r=brade@netscape.com sr=kin@netscape.com a=asa@mozilla.org
This commit is contained in:
parent
75cbf0f7a9
commit
687906579e
@ -2121,7 +2121,7 @@ nsWebBrowserPersist::EnumPersistURIs(nsHashKey *aKey, void *aData, void* closure
|
||||
// Create a URI from the key
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), ((nsCStringKey *) aKey)->GetString());
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
||||
// Make a URI to save the data to
|
||||
nsCOMPtr<nsIURI> fileAsURI;
|
||||
@ -2773,9 +2773,12 @@ nsWebBrowserPersist::StoreURIAttribute(
|
||||
{
|
||||
nsAutoString oldValue;
|
||||
attrNode->GetNodeValue(oldValue);
|
||||
if (!oldValue.IsEmpty())
|
||||
{
|
||||
nsCAutoString oldCValue; oldCValue.AssignWithConversion(oldValue);
|
||||
return StoreURI(oldCValue.get(), aNeedsPersisting, aData);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2924,7 +2927,7 @@ nsWebBrowserPersist::FixupAnchor(nsIDOMNode *aNode)
|
||||
// Make a new URI to replace the current one
|
||||
nsCOMPtr<nsIURI> newURI;
|
||||
rv = NS_NewURI(getter_AddRefs(newURI), oldCValue.get(), relativeURI);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
if (NS_SUCCEEDED(rv) && newURI)
|
||||
{
|
||||
newURI->SetUserPass(NS_LITERAL_CSTRING(""));
|
||||
nsCAutoString uriSpec;
|
||||
|
Loading…
Reference in New Issue
Block a user