element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.34k stars 711 forks source link

Autolinker does not check character types they are not allowed in IDN domain name #6240

Open tateisu opened 2 years ago

tateisu commented 2 years ago

Steps to reproduce

Send message such as それそれ>はじめよう.みんな

The words in sentence are not separated by space, it's standard in Japanese language. But the speaker clearly separates the domain name and the sentence with .

Outcome

What did you expect?

In element-desktop, only はじめよう.みんな was autolinked. this is correct.

What happened instead?

In element-android, all of それそれ>はじめよう.みんな was autolinked.

seems Android version's autolinker does not check character types that not allowed for IDN domain name.

Your phone model

Galaxy S10+

Operating system version

Android 12

Application version and app store

Element-Android 1.4.16 [40104162] (G-b8288)

Homeserver

mastodon.juggler.jp

Will you send logs?

No

Are you willing to provide a PR?

No

ouchadam commented 2 years ago

@tateisu thanks for raising, do you have examples of other apps that correctly handle the autolinking?

tateisu commented 2 years ago

Twitter and Mastodon (both does server side markup) ignores IDN domain instead of invalid autolink. I think it's also reasonable solution.