URLs with ' cannot be edited & saved #1801

Open
ozh opened this Issue Nov 1, 2014 · 1 comment

Comments

Projects
None yet
3 participants
@ozh
Member

ozh commented Nov 1, 2014

Examples: https://www.google.com/search?q=it's+cool or https://www.google.com/search?q=it%27s+nice

The problem is known, I'm just filing an issue to hopefully avoid new issues on the matter.

Why it fails:

yourls_edit_link() escapes $url and compares it with the old URL associated with the submitted keyword. But escape of it's cool becomes it\'s cool and thus the function thinks we try to submit a different URL keeping the same keyword, and then returns an error because that keyword is already in use.

Resolution:

Short term resolution would be obviously to replace $url = yourls_escape( $url ) with $sql_url = yourls_escape( $url ) and use $sql_url in all SQL statements. But: there are a gazillion queries with the same problem.

A much better longer term resolution is to eventually have the proper prepare functions we've been needed for years -- see Roadmap. Deferred to 1.8

@Kiroteryn

This comment has been minimized.

Show comment
Hide comment
@Kiroteryn

Kiroteryn May 18, 2016

I have this issue as well. What's odd is that.. It worked fine for a couple months and only today did this start happening. I have about 3 pages of links.

I have this issue as well. What's odd is that.. It worked fine for a couple months and only today did this start happening. I have about 3 pages of links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment