You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Kenji Matsuoka (JIRA)" <ji...@apache.org> on 2006/12/12 20:40:21 UTC

[jira] Created: (VALIDATOR-216) UrlValidator rejects top-level domains (TLDs) with more than 4 characters

UrlValidator rejects top-level domains (TLDs) with more than 4 characters
-------------------------------------------------------------------------

                 Key: VALIDATOR-216
                 URL: http://issues.apache.org/jira/browse/VALIDATOR-216
             Project: Commons Validator
          Issue Type: Bug
    Affects Versions: 1.3.1 Release
            Reporter: Kenji Matsuoka
            Priority: Minor


org.apache.commons.validator.UrlValidator#isValidAuthority rejects top-level domains (TLDs) with more than four characters.   There are now at least two TLDs with more characters,  .museum and .travel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (VALIDATOR-216) UrlValidator rejects top-level domains (TLDs) with more than 4 characters

Posted by "Gabriel Belingueres (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VALIDATOR-216?page=all ]

Gabriel Belingueres updated VALIDATOR-216:
------------------------------------------

    Attachment: TLDConstants.java

> UrlValidator rejects top-level domains (TLDs) with more than 4 characters
> -------------------------------------------------------------------------
>
>                 Key: VALIDATOR-216
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-216
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.3.1 Release
>            Reporter: Kenji Matsuoka
>            Priority: Minor
>         Attachments: TLDConstants.java
>
>
> org.apache.commons.validator.UrlValidator#isValidAuthority rejects top-level domains (TLDs) with more than four characters.   There are now at least two TLDs with more characters,  .museum and .travel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (VALIDATOR-216) UrlValidator rejects top-level domains (TLDs) with more than 4 characters

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VALIDATOR-216?page=all ]

Niall Pemberton updated VALIDATOR-216:
--------------------------------------

    Fix Version/s: 1.4
         Assignee: Niall Pemberton

My first thought was this had already been fixed - but turned out that was for the email validator - VALIDATOR-66. I'm in the process of separating out the "framework" aspect of validator from the actual validation "routines":

  http://jakarta.apache.org/commons/validator/apidocs/org/apache/commons/validator/routines/package-summary.html#package_description

So the plan is to move UrlValidator into the new routines package and at the same time take the opportunity to re-factor it. Seems to me that both this validator and the EmailValidator could benefit from breaking this down into smaller re-usable routines - so for example having a common domain validator that Url and Email both (re-) used would be a good idea.

Thanks for reporting this Kenji and for the patch Gabriel - I'll take this issue into account when I get round to the refactoring.


> UrlValidator rejects top-level domains (TLDs) with more than 4 characters
> -------------------------------------------------------------------------
>
>                 Key: VALIDATOR-216
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-216
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.3.1 Release
>            Reporter: Kenji Matsuoka
>         Assigned To: Niall Pemberton
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: TLDConstants.java
>
>
> org.apache.commons.validator.UrlValidator#isValidAuthority rejects top-level domains (TLDs) with more than four characters.   There are now at least two TLDs with more characters,  .museum and .travel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (VALIDATOR-216) UrlValidator rejects top-level domains (TLDs) with more than 4 characters

Posted by "Gabriel Belingueres (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/VALIDATOR-216?page=comments#action_12458009 ] 
            
Gabriel Belingueres commented on VALIDATOR-216:
-----------------------------------------------

We could modify it this way (surely there are better ways, but this will quicly patch it for the medium term:

1) Make UrlValidator implement the TLDConstants interface.
2) Replace:
            if (topLevel.length() < 2 || topLevel.length() > 4) {
for this:
            if (Arrays.binarySearch(TLDs, topLevel.toUpperCase()) < 0) {

See attached file for the TLDConstants.java file, which can be easily regenerated each time a new release is about to be generated (though I don't really know how often TLDs varies, but I could guess that not much).

Gabriel


> UrlValidator rejects top-level domains (TLDs) with more than 4 characters
> -------------------------------------------------------------------------
>
>                 Key: VALIDATOR-216
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-216
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.3.1 Release
>            Reporter: Kenji Matsuoka
>            Priority: Minor
>         Attachments: TLDConstants.java
>
>
> org.apache.commons.validator.UrlValidator#isValidAuthority rejects top-level domains (TLDs) with more than four characters.   There are now at least two TLDs with more characters,  .museum and .travel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org