From 113f87b317ed7de9f85f9d13ec76d2b66df0044a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Wed, 13 Oct 2010 13:59:31 +0000 Subject: [PATCH] return an empty string if the script don't ends with 'OpenLayers.js', add OpenLayers.VERSION_NUMBER. r=elemoine (closes #2873) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10823 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/SingleFile.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/SingleFile.js b/lib/OpenLayers/SingleFile.js index 7188c5a2ee..55fb854e44 100644 --- a/lib/OpenLayers/SingleFile.js +++ b/lib/OpenLayers/SingleFile.js @@ -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$";