You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2017/02/04 14:19:48 UTC

svn commit: r1781671 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java

Author: sebb
Date: Sat Feb  4 14:19:48 2017
New Revision: 1781671

URL: http://svn.apache.org/viewvc?rev=1781671&view=rev
Log:
VALIDATOR-411 UrlValidator accepts ports above max limit of 16-bit unsigned integer - oops left off change

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781671&r1=1781670&r2=1781671&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sat Feb  4 14:19:48 2017
@@ -148,8 +148,8 @@ public class UrlValidator implements Ser
             USERINFO_CHARS_REGEX + "+:" + // At least one character for the name
             USERINFO_CHARS_REGEX + "*@"; // password may be absent
     private static final String AUTHORITY_REGEX =
-            "(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(:\\d*)?(.*)?";
-    //             1                          e.g. user:pass@          2                                   3       4
+            "(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(?::(\\d*))?(.*)?";
+    //             1                          e.g. user:pass@          2                                         3       4
     private static final Pattern AUTHORITY_PATTERN = Pattern.compile(AUTHORITY_REGEX);
 
     private static final int PARSE_AUTHORITY_IPV6 = 1;