Modify

Opened 4 years ago

Last modified 4 years 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 by andrewpmk@…, 4 years ago

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 by skyper, 4 years ago

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 by skyper, 4 years ago

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

comment:4 by skyper, 4 years ago

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. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to andrewpmk@….
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.