Opened 9 years ago

Last modified 2 years ago

#11212 assigned defect

[patch]dojox.validate.isUrl doesn't validate certain urls correctly

Reported by: Wiiboy Owned by: dylan
Priority: high Milestone: 1.14
Component: Dojox Version: 1.4.3
Keywords: Cc: Douglas Hays
Blocked By: Blocking:

Description

It looks like dojox.validate.isUrl doesn't return true if a url has multiple symbols in a row, even if the url is valid. For example, it returns false on all of the following:

http://www.mysite.com/#bla http://www.mysite.com/?bla=x http://www.mysite.com/bla/?x=y http://www.mysite.com/bla/#x

The key there is the ending slash, followed immediately by either a ? or #.

Attachments (1)

regexp[1].js (11.4 KB) - added by tsemachh 7 years ago.
dojo 1.8.1 dojox regex patch file with the fix to that issue

Download all attachments as: .zip

Change History (11)

comment:1 Changed 9 years ago by James Burke

Component: GeneralDojox
Owner: changed from anonymous to Adam Peller

comment:2 Changed 7 years ago by tsemachh

dojox.regexp.js

Changed the pathRE regex from

"(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]+(?:\\?[^?#\\s/]*)?(?:#[A-Za-z][\\w.:-]*)?)?)?"

To:

"(/(?:)*?([^\\s/])([^?#\\s/]+/)*(?:[^?#\\s/]+(?:\\?[^?#\\s/]*)?(?:#[A-Za-z][\\w.:-]*)?)?)?"

The problem was with

[^?#\\s/]

which indicates that ? and # signs are not allowed after /.

Changed it so they will be allowed once.

Changed 7 years ago by tsemachh

Attachment: regexp[1].js added

dojo 1.8.1 dojox regex patch file with the fix to that issue

comment:3 Changed 7 years ago by Adam Peller

Summary: dojox.validate.isUrl doesn't validate certain urls correctly[patch]dojox.validate.isUrl doesn't validate certain urls correctly

comment:4 Changed 6 years ago by mlagree

this dojox regexp patch has not been applied in dojo 1.9.0. Disappointing.

comment:5 Changed 6 years ago by bill

I agree, it's disappointing. It would help if you submitted the change as a pull request with tests added to tests/validate.js, after filling out a http://dojofoundation.org/about/cla.

comment:6 Changed 6 years ago by Adam Peller

Cc: Douglas Hays added

comment:7 Changed 4 years ago by dylan

Milestone: tbd1.11
Owner: changed from Adam Peller to dylan
Status: newassigned

I'll review and land this for 1.11.

comment:8 Changed 4 years ago by dylan

Milestone: 1.111.12

Ok, after massive triage, ended up with about 80 tickets for 1.11 and 400 or so for 1.12. That's a bit unrealistic, so first I changed all 1.12 to 1.13 (with the plan to move some forward to the new 1.12. Now, I'm moving some of the 1.11 tickets that are less likely to get done this month without help to 1.11. Feel free to help out in January if you want to see this ticket land in 1.11.

comment:9 Changed 3 years ago by dylan

Milestone: 1.121.13

Ticket planning... move current 1.12 tickets out to 1.13 that likely won't get fixed in 1.12.

comment:10 Changed 2 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.