lionleaf / dwitter

Social network for short js demos
https://www.dwitter.net
Apache License 2.0
764 stars 69 forks source link

Bug when links in comments contain anchors #474

Closed imscary closed 3 years ago

imscary commented 4 years ago

Issue found by u/pavel I recreated the bug here: d/18324 Description: when somebody wants to write a comment that contains a link like this:

http://www.website.com/page#anchor

anchor will be detected as a hashtag and will break the automatic URL formatting. When posted, that url will turn into

#anchor" rel="nofollow">http://www.website.com/page#anchor

Victim dweet: d/18323

This bug can be solved by adding the hashtag regex parsing before the url parsing or something like that