make _getScriptLocation RegExp more robust, p=jpfiset, t,r=me

This commit is contained in:
Éric Lemoine
2012-04-04 20:30:50 +02:00
parent 5c597de900
commit b1b4736315
4 changed files with 7 additions and 7 deletions

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++) {