﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10696	[PATCH] Provide a fix for website's with no scheme	brianegge	team	"Frequently, the website tag is missing it's scheme. Id doesn't require this and it's not obvious that the scheme is required. The following patch will correct the scheme where it's obviously missing.

{{{#!diff

Index: src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java
===================================================================
--- src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java	(revision 7695)
+++ src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java	(working copy)
@@ -156,6 +156,9 @@
     private static final String PORT_REGEX = ""^:(\\d{1,5})$"";
     private static final Pattern PORT_PATTERN = Pattern.compile(PORT_REGEX);
 
+    private static final String SIMPLE_WEBSITE = ""^www[.].*"";
+    private static final Pattern SIMPLE_WEBSITE_PATTERN = Pattern.compile(SIMPLE_WEBSITE);
+
     /**
      * Holds the set of current validation options.
      */
@@ -297,6 +300,9 @@
         String scheme = urlMatcher.group(PARSE_URL_SCHEME);
         if (!isValidScheme(scheme)) {
             setErrorMessage(tr(""URL contains an invalid protocol: {0}"", scheme));
+            if (SIMPLE_WEBSITE_PATTERN.matcher(value).matches()) {
+                setFix(""http://"" + value);
+            }
             return false;
         }
}}}"	enhancement	closed	normal	14.11	Core validator		fixed		
