Page MenuHomePhabricator

User reported issue with some articles opening the wrong URLs when tapping view in browser
Open, In Progress, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):
From the user
Example A:

  1. Go to the Vivian Vance article https://en.wikipedia.org/wiki/Vivian_Vance in the app and scroll down to "External links".
  1. Click the link in the "Wikimedia Commons has media related to Vivian Vance" template.
  1. The link leads to my browser loading "Category:Vivian" on Commons instead of "Category:Vivian Vance".

Example B:

  1. Go to the article for "American Sign Language" https://en.wikipedia.org/wiki/American_Sign_Language in the app and scroll down to "External Links."
  1. Click the links in the "American Sign Language at Wikipedia's sister projects" template.
  1. The links to Wiktionary, Commons, and Wikibooks all take my browser to "Category:American" on that project instead of "Category:American Sign Language".

Tested with both the Fennec and DuckDuckGo browsers on Android.

Version: 50566-r-2026-02-04
Device: motorola moto g stylus 5G - 2024 (SDK: 35)

What happens?:
Tapping view in browser send the user to the wrong URL/Article

What should have happened instead?:
The correct URL/Article

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

NOTE: I have not been able to reproduce this issue. I tested it on all my Android and iOS devices. Perhaps it is a browser issue, as the user notes trying it on non-native browsers (Fennec and DuckDuckGo). Please view the video to see the complete behavior. Other information (browser name/version, screenshots, etc.):

https://drive.google.com/file/d/1x3mUaejltOLQ7C8EzAM01qLbxWGOybpX/view?usp=sharing

Event Timeline

MacMartin77 changed the task status from Open to In Progress.Apr 27 2026, 9:01 PM

The problem with the code in LinkHandler is that if the url embedded in the messagePayload transferred to onMessage contains an encoded space character (%20). UriUtil.decodeURL will decode it and replace it with a real space character. This is then passed to onUrlClick where it is assigned to the local variable href. This local variable is then used to create an Uri which is assigned to the local variable uri. In this step, the space character is not encoded again. When passing uri to external browsers using onExternalLinkClicked, it depends on the functionality of the browser how the raw space character is interpreted. Apparently, DuckDuckGo (and potentially further browsers) process only the first part of the uri - ignoring the second part after the space character.