diegocr / CleanLinks

Converts obfuscated/nested links to genuine clean links.
166 stars 45 forks source link

Parsing `&` in nested URLs #127

Open crssi opened 8 years ago

crssi commented 8 years ago

You will know what I mean...

  1. open web page https://addons.mozilla.org/en-US/firefox/addon/clean-links/
  2. navigate the line "If you have some question/suggestion please use the Support Site, to report problems you can also use the Github Tracker."
  3. click on a "Support Site" link in the line from step no. 2

It does the cleaning, but everything after "&" in the target attribute is stipped out, so I cannot really visit this link.

diegocr commented 8 years ago

That is actually a bug on the AMO site, unfortunately.

...90f9df4c8bc5e188a9021fd2/http%3A//forums.mozillazine.org/viewtopic.php%3Ff=48&t=2749445

The last & character should be URL-encoded as %26, but it is failing to do so.

Hence, the link-cleaning algorithm of this add-on thinks it's part of the original URL, and does not includes anything beyond it.

crssi commented 8 years ago

Are there also a cases where part of the original URL is suffixed? Or you could assume that everything behind a "match" should also be part of cleaned URL?

EDIT: Bummer, have checked https://validator.w3.org/ and you are right. Sorry to bother you. Anyway, thank you for great mod.