aaroneaton / better-yourls

Source code for the Better YOURLS WordPress plugin
21 stars 6 forks source link

Titles are submitted to YOURLS (mostly) without spaces #10

Closed dgw closed 8 years ago

dgw commented 8 years ago

I have a lot of CamelCase link titles in my YOURLS database now.

For example, the post title "New Version of WOT Released" becomes "NewVersionofWOTReleased" when submitted to YOURLS by this plugin.

Oddly enough, some have spaces in rare cases, e.g. "Gdrive Rumors Surface Again" becomes "GdriveRumorsSurface Again".

I want to say this is a result of using sanitize_title(), but I haven't been able to definitively trace it to anything.

domsammut commented 8 years ago

I believe it's related to this function: esc_url_raw. Removing the function results in expected output.

The function appears to be intended for use on actual URL values, not an entire array of arguments based on the documentation. Perhaps it would be better to sanitize each array value according to the type of data?

ChrisWiegman commented 8 years ago

Good point. If time permits I'll actually start getting some code on this stuff in this weekend.

dgw commented 8 years ago

Looks like it's solved in 3e6d2f3 / 2.0.1, but I'll hold off on closing until I publish my next post tomorrow or Monday and confirm what happens when its URL is shortened.

dgw commented 8 years ago

Fixed in 2.0.1, confirmed just now when I published a post. Thanks!