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

The link generated for a tag with special characters in its name is double-escaped #49

Open
zackw opened this issue Mar 8, 2018 · 1 comment

Comments

@zackw
Copy link

zackw commented Mar 8, 2018

If you have a tag with a name that's got URI special characters in it, e.g. "status:404 NOT FOUND", which contains spaces and a colon, the HTML generated for that tag will be something like

<a class="tag" data-tag-id="63786" data-tag-name="http-response:404 NOT FOUND"
   data-hub-id="1" data-hub-feed-id="12" data-hub-feed-item-id="127764"
   href="/hubs/1/tag/http-response%253A404%2520NOT%2520FOUND">http-response:404 NOT FOUND</a>

in which the special characters have been double-escaped when generating the link to the all-items-with-this-tag page. The correct link would be to /hubs/1/tag/http-response%3A404%20NOT%20FOUND.

These links are always generated with code of the form

link_to hub_tag_show_path(hub_id, u(tag.name)) ...

and I believe the problem is that u escapes URI special characters once, and then hub_tag_show_path does it again. However, I cannot find the documentation for u (which I presume is a Rails built-in) nor can I find the definition of hub_tag_show_path (which has to be somewhere in the TagTeam source code, but grep -r show_path * from the top level only brings up the uses!) so I cannot be certain of this.

@zackw
Copy link
Author

zackw commented Mar 8, 2018

This also affects all uses of hub_tag_rss_path, hub_tag_atom_path, and hub_tag_json_path. I can't find the definitions of those either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant