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

Wrong trailing semicolon on URL #1141

Open
tafli opened this issue Jun 13, 2022 · 3 comments
Open

Wrong trailing semicolon on URL #1141

tafli opened this issue Jun 13, 2022 · 3 comments
Labels
bug It's a bug!

Comments

@tafli
Copy link

tafli commented Jun 13, 2022

Bug Description

I recognized this behavior when sharing CURL-Request.

When sending a URL with a trailing '/' or sub path and trailing single quote ('), the text appears with an additional ; at the end in Threema-Web. On a mobile app (tested on Android only), the text appears correctly.

Examples:
'foo.bar -> 'foo.bar
'foo.bar' -> 'foo.bar'
'foo.bar/' -> 'foo.bar/';
'foo.bar/x' -> 'foo.bar/x';

The leading ' doesn't need to exist. foo.bar/x' has the same effect.

It also works, when trailing the ' with additional ;. In this case a ; is added as well:
foo.bar/x';;; -> foo.bar/x';;;;

Using the copy function, the correct text is copied without the trailing ;.

Steps to Reproduce (for bugs)

Send following text: foo.bar/x'

Expected behaviour

Sent text is shown correctly.

Your Environment

  • Threema Web version: 2.4.1
@tafli tafli added awaiting triage Should be triaged by a developer. bug It's a bug! labels Jun 13, 2022
@bratkartoffel
Copy link

Can reproduce this issue using Firefox 101.0.1 and MS Edge 102.0.1245.39

@threema-danilo threema-danilo removed the awaiting triage Should be triaged by a developer. label Jun 14, 2022
@threema-danilo
Copy link
Contributor

Confirmed. This is an interaction between HTML escaping and the linkify filter... The text first gets converted into foo.bar/x&#039; then into <a href="http://foo.bar/x&#039" class="autolinked autolinked-url" target="_blank" rel="noopener noreferrer">foo.bar/x&#039</a>;.

@threema-danilo
Copy link
Contributor

Hmm, this one is tricky. We generally want to do HTML escaping first, before applying other filters. However, this causes some issues with autolinker, see gregjacobs/Autolinker.js#197. I can't yet promise a quick solution, especially since you are the first person that reports this issue in the 5 years since it was released 🙂 If someone has a good idea of how to solve this, PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug!
Development

No branches or pull requests

3 participants