You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Stephen Chu (JIRA)" <ji...@apache.org> on 2006/12/19 03:35:22 UTC

[jira] Commented: (VALIDATOR-218) UrlValidator fail when path contains "(" / ")"

    [ http://issues.apache.org/jira/browse/VALIDATOR-218?page=comments#action_12459521 ] 
            
Stephen Chu commented on VALIDATOR-218:
---------------------------------------

To fix it,
change the PATH_PATTERN to include "(" and ")"

private static final String PATH_PATTERN = "/^(/[-\\w:@&?=+,.!/~*'%$_;\\(\\)]*)?$/";



> UrlValidator fail when path contains "(" / ")"
> ----------------------------------------------
>
>                 Key: VALIDATOR-218
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-218
>             Project: Commons Validator
>          Issue Type: Bug
>    Affects Versions: 1.3.1 Release
>         Environment: JDK 1.5, Linux
>            Reporter: Stephen Chu
>
> for validating the URL "http://somewhere.com/pathxyz/file(1).html", it returns false.
> According to the RFC,
> uric          = reserved | unreserved | escaped
> reserved      = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
>                       "$" | ","
> unreserved    = alphanum | mark
> mark          = "-" | "_" | "." | "!" | "~" | "*" | "'" |
>                       "(" | ")"
> "(", ")" belongs to mark and is a valid part of uric.
> Test case:
> UrlValidator validator = new UrlValidator({"http","https"}, UrlValidator.ALLOW_2_SLASHES);
> validator.isValid("http://somewhere.com/pathxyz/file(1).html");

-- 
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