From a63e3d7d6584a15458a16f092300c758b43beb85 Mon Sep 17 00:00:00 2001 From: "jst%mozilla.org" Date: Wed, 28 Feb 2007 00:33:22 +0000 Subject: [PATCH] Fix part of bug 343999. Make window.home() go to the first home page if more than one are specified. r=jonas@sicking.cc, sr=dveditz@cruzio.com git-svn-id: svn://10.0.0.236/trunk@221041 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsGlobalWindow.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index ba290d17acf..4050aff57ce 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -3827,6 +3827,25 @@ nsGlobalWindow::Home() CopyASCIItoUTF16(DEFAULT_HOME_PAGE, homeURL); } +#ifdef MOZ_PHOENIX + { + // Firefox lets the user specify multiple home pages to open in + // individual tabs by separating them with '|'. Since we don't + // have the machinery in place to easily open new tabs from here, + // simply truncate the homeURL at the first '|' character to + // prevent any possibilities of leaking the users list of home + // pages to the first home page. + // + // Once bug https://bugzilla.mozilla.org/show_bug.cgi?id=221445 is + // fixed we can revisit this. + PRInt32 firstPipe = homeURL.FindChar('|'); + + if (firstPipe > 0) { + homeURL.Truncate(firstPipe); + } + } +#endif + nsresult rv; nsCOMPtr webNav(do_QueryInterface(mDocShell)); NS_ENSURE_TRUE(webNav, NS_ERROR_FAILURE); @@ -5289,7 +5308,7 @@ nsGlobalWindow::Atob(const nsAString& aAsciiBase64String, return NS_ERROR_DOM_INVALID_CHARACTER_ERR; } - PRInt32 dataLen = aAsciiBase64String.Length(); + PRUint32 dataLen = aAsciiBase64String.Length(); NS_LossyConvertUTF16toASCII base64(aAsciiBase64String); if (base64.Length() != dataLen) {