Issue Details (XML | Word | Printable)

Key: VALIDATOR-204
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ben
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Commons Validator

isValid return false for a valid URL

Created: 06/Oct/06 12:34 AM   Updated: 12/Nov/07 07:25 PM
Return to search
Component/s: None
Affects Version/s: 1.3.0 Release
Fix Version/s: 1.3.1 Release

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works VALIDATOR-204.patch 2006-10-06 10:44 PM Henri Yandell 2 kB
Environment: JBOSS, Linux

Resolution Date: 06/Oct/06 09:46 PM


 Description  « Hide
IsValid returns false for the following valid Url:

http://tech.yahoo.com/rc/desktops/102;_ylt=Ao8yevQHlZ4On0O3ZJGXLEQFLZA5

Stepping thru the code isValidPath return false for the above URL.

Test Code:

String[] schemes = {"http","https"}.
UrlValidator urlValidator = new UrlValidator(schemes) ;
urlValidator.isValid("http://tech.yahoo.com/rc/desktops/102;_ylt=Ao8yevQHlZ4On0O3ZJGXLEQFLZA5") ;



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #453757 Fri Oct 06 20:33:55 UTC 2006 bayard Applying unit test for #VALIDATOR-204
Files Changed
MODIFY /jakarta/commons/proper/validator/trunk/src/test/org/apache/commons/validator/UrlTest.java

Repository Revision Date User Message
ASF #453758 Fri Oct 06 20:36:38 UTC 2006 bayard Remove debug from #VALIDATOR-204
Files Changed
MODIFY /jakarta/commons/proper/validator/trunk/src/test/org/apache/commons/validator/UrlTest.java

Henri Yandell added a comment - 06/Oct/06 09:29 PM
The pattern is:

/^(/[-\\w:@&?=+,.!/~*'%$]*)?$/

So the above url fails on the ; and the _. I don't see any reason why they're not being allowed. Looking at the ietf page, it seems to be fine there.


Repository Revision Date User Message
ASF #453784 Fri Oct 06 21:44:55 UTC 2006 bayard Adding _ and ; to the list of allowed characters within the path component of a URL. _ is definitely allowed and ; is allowed but there are restrictions on its use and we'll need to refactor UrlValidator to properly understand how a ; may be used for path parameterization. This is with reference to #VALIDATOR-204.
Files Changed
MODIFY /jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/UrlValidator.java

Henri Yandell added a comment - 06/Oct/06 09:46 PM
svn ci -m "Adding _ and ; to the list of allowed characters within the path component of a URL. _ is definitely allowed and ; is allowed but there are restrictions on its use and we'll need to refactor UrlValidator to properly understand how a ; may be used for path parameterization. This is with reference to #VALIDATOR-204."

Sending src/share/org/apache/commons/validator/UrlValidator.java
Transmitting file data .
Committed revision 453784.


Henri Yandell made changes - 06/Oct/06 09:46 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.3.1 [ 12311934 ]
Henri Yandell added a comment - 06/Oct/06 10:44 PM
This was done as a part of the day-job; so attaching a patch to signify that I passed it from my day-job role to my apache-role.

Henri Yandell made changes - 06/Oct/06 10:44 PM
Attachment VALIDATOR-204.patch [ 12342482 ]
Henri Yandell made changes - 12/Nov/07 07:25 PM
Status Resolved [ 5 ] Closed [ 6 ]