ForceExternal: Compare hostnames case insensitive
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 6 Feb 2013 21:01:49 +0000 (16:01 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 13 Feb 2013 04:25:19 +0000 (23:25 -0500)
Lowercase both sides to avoid "right host, wrong case" issues.

Resolves LP1081699 where the external browser would be used due to
hostname case sensitivity.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/components/forceexternal.js

index ff0ac5f..d5e26d7 100644 (file)
@@ -20,7 +20,7 @@ oilsForceExternal.prototype = {
           && node && node.getAttribute('oils_force_external') == 'true') {
             var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService().wrappedJSObject.data;
             var host = data_cache.server_unadorned;
           && node && node.getAttribute('oils_force_external') == 'true') {
             var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService().wrappedJSObject.data;
             var host = data_cache.server_unadorned;
-            if(host && contentLocation.host != host) {
+            if(host && contentLocation.host.toLowerCase() != host.toLowerCase()) {
                 // first construct an nsIURI object using the ioservice
                 var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
                                 .getService(Components.interfaces.nsIIOService);
                 // first construct an nsIURI object using the ioservice
                 var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
                                 .getService(Components.interfaces.nsIIOService);