Check that location.href is sane before using it, to avoid
obscure browser bugs.


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10931 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBase.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBase.js
index 217546f..52b6d93 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBase.js
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBase.js
@@ -90,6 +90,12 @@
     }
     return '';
   }
+
+  function isLocationOk() {
+    var loc = $doc.location;
+    return loc.href ==
+        (loc.protocol + "//" + loc.host + loc.pathname + loc.search + loc.hash);
+  }
   
 // ================ Inline Code =============================================
   var tempBase = tryMetaTag();
@@ -99,10 +105,10 @@
   if (tempBase == '') {
     tempBase = tryBaseTag();
   }
-  if (tempBase == '') {
+  if (tempBase == '' && isLocationOk()) {
     // last resort
     tempBase = getDirectoryOfFile($doc.location.href);
-  }  
+  }
   tempBase = ensureAbsoluteUrl(tempBase);
   return tempBase;
 }