[ 
https://issues.apache.org/jira/browse/VALIDATOR-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992474#comment-14992474
 ] 

Sebb commented on VALIDATOR-363:
--------------------------------

The patch works for the provided examples, however it does not work for the 
following URL:

"http://www.example.org/..world/";

AFAICT this should be allowed

However if the check is changed to

int dot2Count = countToken("../", path); 

then another test fails with:

junit.framework.AssertionFailedError: http://www.google.com:80/..?action=view 
expected:<false> but was:<true>

> UrlValidator rejects path having two or more successive dots
> ------------------------------------------------------------
>
>                 Key: VALIDATOR-363
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-363
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.4.1 Release
>            Reporter: Stefan Pi
>         Attachments: VALIDATOR-363.patch
>
>
> Minmal example:
> {code}
> UrlValidator urlValidator = new UrlValidator();
> boolean isValidOneDot = 
> urlValidator.isValid("http://www.example.org/hello.world/";); // evaluates to 
> true
> boolean isValidTwoDots = 
> urlValidator.isValid("http://www.example.org/hello..world/";); // evaluates to 
> false
> {code}
> Real world example:
> {code}
> UrlValidator urlValidator = new UrlValidator();
> boolean isValidRealWord = 
> urlValidator.isValid("http://forum.golem.de/sonstiges/trollwiese/apple-bashing-in-3...2...1...go/98,4089549,4089549,read.html#msg-4089549";);
>  // evaluates to false
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to