Don't show username/password in the URI we print. Bug 186695, r=jst, sr=darin
git-svn-id: svn://10.0.0.236/trunk@170875 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -169,6 +169,9 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIFocusController.h"
|
||||
|
||||
#include "nsCDefaultURIFixup.h"
|
||||
#include "nsIURIFixup.h"
|
||||
|
||||
//-----------------------------------------------------
|
||||
// PR LOGGING
|
||||
#ifdef MOZ_LOGGING
|
||||
@@ -1822,9 +1825,17 @@ nsPrintEngine::GetDocumentTitleAndURL(nsIDocument* aDoc,
|
||||
nsIURI* url = aDoc->GetDocumentURI();
|
||||
if (!url) return;
|
||||
|
||||
nsCOMPtr<nsIURIFixup> urifixup(do_GetService(NS_URIFIXUP_CONTRACTID));
|
||||
if (!urifixup) return;
|
||||
|
||||
nsCOMPtr<nsIURI> exposableURI;
|
||||
urifixup->CreateExposableURI(url, getter_AddRefs(exposableURI));
|
||||
|
||||
if (!exposableURI) return;
|
||||
|
||||
nsCAutoString urlCStr;
|
||||
url->GetSpec(urlCStr);
|
||||
*aURLStr = ToNewUnicode(NS_ConvertUTF8toUCS2(urlCStr));
|
||||
exposableURI->GetSpec(urlCStr);
|
||||
*aURLStr = UTF8ToNewUnicode(urlCStr);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user