diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index d28ac28ad12..607d8924b22 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1005,6 +1005,7 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, NS_ERROR_FAILURE); // we should only perform a keyword search under the following conditions: + // (0) Pref keyword.enabled is true // (1) the url scheme is http (or https) // (2) the url does not have a protocol scheme // If we don't enforce such a policy, then we end up doing keyword searchs on urls @@ -1014,10 +1015,10 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, // if we want keywords enabled...this is just a bandaid... static const char httpSchemeName[] = "http"; - if (schemeStr.IsEmpty() || !schemeStr.Find(httpSchemeName) ) - keywordsEnabled = PR_TRUE; // keep keywors enabled for this url - else - keywordsEnabled = PR_FALSE; // all other cases, disable keywords for this url. + if (keywordsEnabled) { + if (!schemeStr.IsEmpty() && ((schemeStr.Find(httpSchemeName)) != 0)) + keywordsEnabled = PR_FALSE; + } if(keywordsEnabled && (-1 == dotLoc)) {