Skip to content

Commit

Permalink
return an empty string if the script don't ends with 'OpenLayers.js',…
Browse files Browse the repository at this point in the history
… add OpenLayers.VERSION_NUMBER. r=elemoine (closes #2873)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10823 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
  • Loading branch information
fredj committed Oct 13, 2010
1 parent 485ebaa commit 113f87b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/OpenLayers/SingleFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ var OpenLayers = {
singleFile: true,
_getScriptLocation: (function() {
var s = document.getElementsByTagName('script');
var l = s[s.length-1].getAttribute("src").match(/(^|(.*?\/))(OpenLayers\.js)(\?|$)/)[1];
var match = s[s.length-1].getAttribute("src").match(/(^|(.*?\/))(OpenLayers\.js)(\?|$)/);
var l = match ? match[1] : "";
return (function() { return l; });
})()
};


/**
* Constant: VERSION_NUMBER
*/
OpenLayers.VERSION_NUMBER="$Revision$";

0 comments on commit 113f87b

Please sign in to comment.