зеркало из https://github.com/mozilla/pjs.git
Bug 382702 - Create a blank URL for session history when an invalid protocol is used. r=biesi
This commit is contained in:
Родитель
156933f7b3
Коммит
a93ef534e8
|
@ -4119,9 +4119,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
|
|||
|
||||
// Display the error as a page or an alert prompt
|
||||
NS_ENSURE_FALSE(messageStr.IsEmpty(), NS_ERROR_FAILURE);
|
||||
// Note: For now, display an alert instead of an error page if we have no
|
||||
// URI object. Missing URI objects are handled badly by session history.
|
||||
if (mUseErrorPages && aURI) {
|
||||
if (mUseErrorPages) {
|
||||
// Display an error page
|
||||
LoadErrorPage(aURI, aURL, errorPage.get(), error.get(),
|
||||
messageStr.get(), cssClass.get(), aFailedChannel);
|
||||
|
@ -4190,6 +4188,10 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL,
|
|||
}
|
||||
else if (aURL)
|
||||
{
|
||||
// We need a URI object to store a session history entry, so make up a URI
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(mFailedURI), "about:blank");
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
CopyUTF16toUTF8(aURL, url);
|
||||
}
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче