Page MenuHomePhabricator

DOI links in references do not open properly in Safari on iOS mobile
Closed, ResolvedPublic

Description

Hardware: iPhone XS Max 128GB
iOS Version: 14.0
Wikipedia App Version: 6.7.0 (1757)

Description

When clicking on DOI links in references, a broken link opens in Safari that gives a "DOI Not Found" error. This is appears to be due to special characters (such as forward slashes and parentheses) being encoded twice instead of once or not at all.

Example

Take the article "Coronavirus disease 2019". As of 2020-9-17 there is a reference (Han X, et al. (March 2020)) that contains doi:10.1093/cid/ciaa271. The part 10.1093/cid/ciaa271 is a link that should open https://doi.org/10.1093/cid/ciaa271, but instead it opens https://doi.org/10.1093%252Fcid%252Fciaa271. The forward slash is replaced with %252F, demonstrating that it is being encoded twice. First, it is encoded to %2F, and then the % is encoded to %25, resulting in %252F. This occurs with parentheses as well (and probably other special characters, if used.)

Steps To Reproduce

  1. Open the iOS mobile app and navigate to an article with a DOI in a reference (medical-related articles are good for this.)
  2. Click on the identifier link that is found after its page numbers in a journal. For example, it will look something like this: 10.1093/cid/ciaa271 (I only have Safari as a browser, so I don't know if it will ask to choose a browser if you have multiple. If it does, choose Safari. You may also be able to test with other browsers then.)
  3. You should be taken to an error page. If you check the URL, you will notice any special characters are replaced with %25 followed by its URL code point (sans another % sign.) For example, / is replaced with %252F.

Reproduction Rate: 10/10

Additional Info

I have tested this with other external links in references and it only appears to happen with DOI links. I also tested it on the mobile site in Safari and they are fully functional. Manually unencoding characters in the link in Safari fixes it, either fully unencoding the doubly-encoded special characters by replacing %25xx with the character encoded by %xx, or undoing the 2nd encode by removing the 25 part from %25xx to form %xx.

40F4C898-5582-487B-8516-9937AEEFDB16.jpeg (962×1 px, 402 KB)

4F2F6C62-6113-4AAB-B7F9-3C12EF2F20D6.jpeg (304×1 px, 166 KB)

Event Timeline

Another encoding issue on outgoing links for your pile @Dmantena ?

@JMinor Interesting - certainly could be! Here's that original ticket Matt created to collect some of them BTW: https://phabricator.wikimedia.org/T268370 – while the ticket itself is specific to editor names and article as a living doc, some of the cases occur in the article view itself and feels like we've got a nice mix of outgoing encoding issues to explore. Dunno if you want to create a new parent ticket for them or what. Up to you, whatever you think is best.

Liambdonegan01 claimed this task.

This seems to be resolved, as I can now successfully open DOI links.