TrianguloY/URLCheck

Check URLs from clipboard (getLinksFromText) does not support ipv6

Opened this issue · 1 comments

Steps to reproduce

Use the "Check URLs from clipboard" button in the start screen with an URL which contains an ipv6 address e.g. "http://[::1]/"

Expected behavior

URLs with ipv6 addresses should be valid.

Actual behavior

A toast "no links detected" pops up.

URLCheck version

2.14

Android version

Android 14

Android Custom/Specific ROM or Device

GrapheneOS

Other details

The android.util.Patterns.WEB_URL pattern does not match ipv6 addresses.

https://github.com/TrianguloY/UrlChecker/blob/922753520679663b72d76b88080ac2b02c5d20dc/app/src/main/java/com/trianguloy/urlchecker/utilities/methods/AndroidUtils.java#L204

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.

That's an oddly specific bug, but an interesting one.

And yes, the problem is exactly what you mention, that official pattern doesn't allow them.

I want to allow the app to manage other non-http uris, so I'll probably use a more generic uri pattern (and maybe even let the user configure it? Hmm)