Modify

Opened 22 months ago

Last modified 22 months ago

#19616 new enhancement

Better handling of zero-width space (\u200b) in URL

Reported by: andrewpmk@… Owned by: team
Priority: normal Milestone:
Component: Core validator Version: tested
Keywords: validator, url Cc:

Description

The URL validator generates a warning for valid URLs e.g.
https://www.9round.ca/​fitness/​Vaughan-ON-x0298 It generates the warning "URL validator - 'website': URL contains an invalid path: /fitness/Vaughan-ON-x0298". I am using JOSM 16812 on Windows 10.

There appears to be a bug in isValidPath in src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java

Attachments (0)

Change History (4)

comment:1 Changed 22 months ago by andrewpmk@…

It turns out that the URL contains a zero-width space \u200b:

https://www.9round.ca/\u200b/​fitness/\u200b​Vaughan-ON-x0298

So it looks like the validator is working correctly. The error message is not at all obvious though, since the zero-width space is not visible.

comment:2 Changed 22 months ago by skyper

We could check for white spaces in values for some keys like [*:]website and [*:]url.
Not sure if a autofix is useful as it is not clear if it needs to be removed or changed to e.g. underscore.

Watch out for white spaces after semi-colon in cases of multiple values.

comment:3 Changed 22 months ago by skyper

Priority: minornormal
Summary: URL validator flags valid URLs as invalidBetter handling of zero-width space (\u200b) in URL
Type: defectenhancement

comment:4 Changed 22 months ago by skyper

Or simply remove zero-width-spaces in general, automatically?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to andrewpmk@gmail.com
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.