mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 03:00:30 +00:00
Hack fix for bug # 21175: bookmarks without schemes now get "http://" as their default scheme.
This commit is contained in:
parent
79fabcdd17
commit
285c3246e1
@ -1155,9 +1155,17 @@ BookmarkParser::AddBookmark(nsCOMPtr<nsIRDFContainer> aContainer,
|
||||
nsIRDFResource** bookmarkNode)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIRDFResource> bookmark;
|
||||
nsAutoString fullURL(aURL);
|
||||
|
||||
if (NS_FAILED(rv = gRDF->GetResource(aURL, getter_AddRefs(bookmark) )))
|
||||
// hack fix for bug # 21175:
|
||||
// if we don't have a protocol scheme, add "http://" as a default scheme
|
||||
if (fullURL.FindChar(PRUnichar(':')) < 0)
|
||||
{
|
||||
fullURL.Insert("http://", 0);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRDFResource> bookmark;
|
||||
if (NS_FAILED(rv = gRDF->GetResource(nsCAutoString(fullURL), getter_AddRefs(bookmark) )))
|
||||
{
|
||||
NS_ERROR("unable to get bookmark resource");
|
||||
return(rv);
|
||||
@ -2851,7 +2859,8 @@ nsBookmarksService::GetTarget(nsIRDFResource* aSource,
|
||||
}
|
||||
}
|
||||
|
||||
return mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget);
|
||||
rv = mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget);
|
||||
return(rv);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user