Merge pull request #390 from elemoine/scriptlocation

_getScriptLocation regexp not robust enough
This commit is contained in:
Éric Lemoine
2012-04-04 21:43:08 -07:00
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ var OpenLayers = {
* {String} Path to this script
*/
_getScriptLocation: (function() {
var r = new RegExp("(^|(.*?\\/))(OpenLayers.*?\\.js)(\\?|$)"),
var r = new RegExp("(^|(.*?\\/))(OpenLayers[^\\/]*?\\.js)(\\?|$)"),
s = document.getElementsByTagName('script'),
src, m, l = "";
for(var i=0, len=s.length; i<len; i++) {