- Timestamp:
- 2018-03-23T22:22:05+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13549 r13551 25 25 import org.openstreetmap.josm.data.imagery.ImageryInfo 26 26 import org.openstreetmap.josm.data.imagery.Shape 27 import org.openstreetmap.josm.data.projection.Projections; 27 import org.openstreetmap.josm.data.projection.Projections 28 import org.openstreetmap.josm.data.validation.routines.DomainValidator 28 29 import org.openstreetmap.josm.io.imagery.ImageryReader 29 30 … … 552 553 myprintln "- Missing JOSM license URL (${et}): ${getDescription(j)}" 553 554 } else if (et) { 554 myprintln "* License URL differs ('${et}' != '${jt}'): ${getDescription(j)}" 555 def ethttps = et.replace("http:","https:") 556 if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) { 557 myprintln "+ License URL differs ('${et}' != '${jt}'): ${getDescription(j)}" 558 } else { 559 myprintln "* License URL differs ('${et}' != '${jt}'): ${getDescription(j)}" 560 } 555 561 } else if (!options.nomissingeli) { 556 562 myprintln "+ Missing ELI license URL ('${jt}'): ${getDescription(j)}" … … 565 571 } else if (et) { 566 572 def ethttps = et.replace("http:","https:") 567 if(jt.equals(ethttps) ) {573 if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) { 568 574 myprintln "+ Attribution URL differs ('${et}' != '${jt}'): ${getDescription(j)}" 569 575 } else { … … 715 721 def josmIds = new HashMap<String, ImageryInfo>() 716 722 def all = Projections.getAllProjectionCodes() 723 DomainValidator dv = DomainValidator.getInstance(); 717 724 for (def url : josmUrls.keySet()) { 718 725 def j = josmUrls.get(url) … … 750 757 } 751 758 } 752 if(!(url =~ /^https?:\/\//) && !"scanex".equals(getType(j))) { 753 myprintln "* Strange URL: ${getDescription(j)}" 754 } 759 def urls = new LinkedList<String>() 760 if(!"scanex".equals(getType(j))) { 761 urls += url 762 } 763 def jt = getPermissionReferenceUrl(j) 764 if(jt) 765 urls += jt 766 jt = getTermsOfUseUrl(j) 767 if(jt) 768 urls += jt 769 jt = getAttributionUrl(j) 770 if(jt) 771 urls += jt 772 for(def u : urls) { 773 def m = u =~ /^https?:\/\/([^\/]+?)(:\d+)?\// 774 if(!m) 775 myprintln "* Strange URL '${u}': ${getDescription(j)}" 776 else { 777 def domain = m[0][1].replaceAll("\\{switch:.*\\}","x") 778 if (!(domain =~ /^\d+\.\d+\.\d+\.\d+$/) && !dv.isValid(domain)) 779 myprintln "* Strange Domain '${domain}': ${getDescription(j)}" 780 } 781 } 782 755 783 if(josmMirrors.containsKey(url)) { 756 784 continue
Note:
See TracChangeset
for help on using the changeset viewer.