diff --git a/app/assets/javascripts/fp/map/map-options.js b/app/assets/javascripts/fp/map/map-options.js index 4a2fb9c9..dfa9cda0 100644 --- a/app/assets/javascripts/fp/map/map-options.js +++ b/app/assets/javascripts/fp/map/map-options.js @@ -24,11 +24,11 @@ // fits Leaflet's template requirements // http://leafletjs.com/reference.html#tilelayer utils.isTemplateString = function(str) { - var re = /^https?:\/\/(\{[s]\})?[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*\{[zxy]\}\/\{[zxy]\}\/\{[zxy]\}[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*(jpg|png)([\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*)?$/gi; + var re = /^https?:\/\/(\{[s]\})?[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*\{[zxy]\}\/\{[zxy]\}\/\{[zxy]\}[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*$/gi; return re.test(str); }; utils.conformTemplate = function(template) { return template.replace('{S}','{s}').replace('{X}','{x}').replace('{Y}','{y}').replace('{Z}','{z}'); }; -})(this); \ No newline at end of file +})(this); diff --git a/app/models/atlas.rb b/app/models/atlas.rb index 7db49220..a830335d 100644 --- a/app/models/atlas.rb +++ b/app/models/atlas.rb @@ -104,7 +104,7 @@ class Atlas < ActiveRecord::Base # have multiple URL templates not including OVERLAYS def provider_valid p = get_provider_without_overlay - if /\Ahttps?:\/\/(\{[s]\})?[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*\{[zxy]\}\/\{[zxy]\}\/\{[zxy]\}[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*(jpg|png)([\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*)?\z/i !~ p + if /\Ahttps?:\/\/(\{[s]\})?[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*\{[zxy]\}\/\{[zxy]\}\/\{[zxy]\}[\/\w\.\-\?\+\*_\|~:\[\]@#!\$'\(\),=&]*\z/i !~ p errors.add(:provider, "Invalid URL template") end end @@ -577,4 +577,4 @@ def http_client end end -end \ No newline at end of file +end