Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent URLs from being entered containing stray spaces #380

Open
rhigman opened this issue May 18, 2022 · 1 comment
Open

Prevent URLs from being entered containing stray spaces #380

rhigman opened this issue May 18, 2022 · 1 comment
Labels
bug Something isn't working discussion-needed

Comments

@rhigman
Copy link
Member

rhigman commented May 18, 2022

It is possible to enter a value https://creativecommons.org/ licenses/by-nc/4.0/ in the work Licence field (note space between .org/ and licences), even though both the app and the database have constraints which should prevent invalid URL values being entered.

This is not caused by #376 as the behaviour is the same when both adding and editing works. Similar issues exist for the Landing Page, Cover URL, and publication location Landing Page and Full Text URL fields. The bug is presumably in our generic implementation of URL constraints.

@rhigman rhigman added the bug Something isn't working label May 18, 2022
@rhigman
Copy link
Member Author

rhigman commented May 18, 2022

This is slightly complicated as unencoded URLs can validly contain spaces (especially within parameters, e.g. https://twitter.com/search?q="open access"), but they are more safely represented encoded (the example would become https://twitter.com/search?q=%22open%20access%22). The app constraint simply uses the standard HTML <input type="url"> attribute, which accepts spaces for this reason. It is unclear whether it would be appropriate for us to update the database constraint to disallow spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion-needed
Projects
None yet
Development

No branches or pull requests

1 participant