From e180b655fb6d626f4e9f98fc90f4b4ce2a861b68 Mon Sep 17 00:00:00 2001 From: "sdwilsh%shawnwilsher.com" Date: Thu, 5 Jul 2007 22:26:06 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20380932=20-=20Handle=20malware=20URIs=20wi?= =?UTF-8?q?th=20error=20page.=20=20Patch=20by=20D=C3=83=C2=A3o=20Gottwald?= =?UTF-8?q?=20.=20=20r=3Dcbiesinger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@229386 18797224-902f-48f8-a5cc-f745e15eee43 --- .../docshell/resources/content/netError.xhtml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mozilla/docshell/resources/content/netError.xhtml b/mozilla/docshell/resources/content/netError.xhtml index fa8b75cd03d..5bce0393e2f 100644 --- a/mozilla/docshell/resources/content/netError.xhtml +++ b/mozilla/docshell/resources/content/netError.xhtml @@ -86,14 +86,14 @@ function getCSSClass() { var url = document.documentURI; - var class = url.search(/c\=/); + var classParam = url.search(/c\=/); - // c is optional, if class === -1 just return nothing - if (class === -1) + // c is optional, if classParam == -1 just return nothing + if (classParam == -1) return ""; var rest = url.search(/\&/); - return decodeURIComponent(url.slice(class + 2, rest)); + return decodeURIComponent(url.slice(classParam + 2, rest)); } function getDescription() @@ -103,7 +103,8 @@ // desc == -1 if not found; if so, return an empty string // instead of what would turn out to be portions of the URI - if (desc == -1) return ""; + if (desc == -1) + return ""; return decodeURIComponent(url.slice(desc + 2)); } @@ -161,11 +162,11 @@ var errContainer = document.getElementById("errorContainer"); errContainer.parentNode.removeChild(errContainer); - var class = getCSSClass(); - if (class) { + var className = getCSSClass(); + if (className) { // Associate a CSS class with the root of the page, if one was passed in, // to allow custom styling. - document.documentElement.className = class; + document.documentElement.className = className; // Also, if they specified a CSS class, they must supply their own // favicon. In order to trigger the browser to repaint though, we @@ -173,7 +174,7 @@ var favicon = document.getElementById("favicon"); var faviconParent = favicon.parentNode; faviconParent.removeChild(favicon); - favicon.setAttribute("href", "chrome://global/skin/icons/" + class + "_favicon.png"); + favicon.setAttribute("href", "chrome://global/skin/icons/" + className + "_favicon.png"); faviconParent.appendChild(favicon); } }