Index: /trunk/scripts/SyncEditorLayerIndex.groovy
===================================================================
--- /trunk/scripts/SyncEditorLayerIndex.groovy	(revision 13550)
+++ /trunk/scripts/SyncEditorLayerIndex.groovy	(revision 13551)
@@ -25,5 +25,6 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo
 import org.openstreetmap.josm.data.imagery.Shape
-import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.data.projection.Projections
+import org.openstreetmap.josm.data.validation.routines.DomainValidator
 import org.openstreetmap.josm.io.imagery.ImageryReader
 
@@ -552,5 +553,10 @@
                     myprintln "- Missing JOSM license URL (${et}): ${getDescription(j)}"
                 } else if (et) {
-                    myprintln "* License URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
+                    def ethttps = et.replace("http:","https:")
+                    if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) {
+                        myprintln "+ License URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
+                    } else {
+                        myprintln "* License URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
+                    }
                 } else if (!options.nomissingeli) {
                     myprintln "+ Missing ELI license URL ('${jt}'): ${getDescription(j)}"
@@ -565,5 +571,5 @@
                 } else if (et) {
                     def ethttps = et.replace("http:","https:")
-                    if(jt.equals(ethttps)) {
+                    if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) {
                         myprintln "+ Attribution URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
                     } else {
@@ -715,4 +721,5 @@
         def josmIds = new HashMap<String, ImageryInfo>()
         def all = Projections.getAllProjectionCodes()
+        DomainValidator dv = DomainValidator.getInstance();
         for (def url : josmUrls.keySet()) {
             def j = josmUrls.get(url)
@@ -750,7 +757,28 @@
                 }
             }
-            if(!(url =~ /^https?:\/\//) && !"scanex".equals(getType(j))) {
-                myprintln "* Strange URL: ${getDescription(j)}"
-            }
+            def urls = new LinkedList<String>()
+            if(!"scanex".equals(getType(j))) {
+              urls += url
+            }
+            def jt = getPermissionReferenceUrl(j)
+            if(jt)
+              urls += jt
+            jt = getTermsOfUseUrl(j)
+            if(jt)
+              urls += jt
+            jt = getAttributionUrl(j)
+            if(jt)
+              urls += jt
+            for(def u : urls) {
+                def m = u =~ /^https?:\/\/([^\/]+?)(:\d+)?\//
+                if(!m)
+                    myprintln "* Strange URL '${u}': ${getDescription(j)}"
+                else {
+                    def domain = m[0][1].replaceAll("\\{switch:.*\\}","x")
+                    if (!(domain =~ /^\d+\.\d+\.\d+\.\d+$/) && !dv.isValid(domain))
+                        myprintln "* Strange Domain '${domain}': ${getDescription(j)}"
+                }
+            }
+
             if(josmMirrors.containsKey(url)) {
                 continue
