Check that location.href is sane before using it, to avoid
obscure browser bugs. (Apply to computeScriptBaseOld.js as well.)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10942 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js
index 3d4b61a..09e783a 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js
@@ -117,7 +117,13 @@
}
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();
if (tempBase == '') {
@@ -129,7 +135,7 @@
if (tempBase == '') {
tempBase = tryBaseTag();
}
- if (tempBase == '') {
+ if (tempBase == '' && isLocationOk()) {
// last resort
tempBase = getDirectoryOfFile($doc.location.href);
}