⚓ T365483 Links from mobile go back to desktop host when using Parsoid Read Views
Page MenuHomePhabricator

Links from mobile go back to desktop host when using Parsoid Read Views
Closed, ResolvedPublic

Description

The links on (eg) https://en.m.wikipedia.org/wiki/Duria_Antiquior?useparsoid=1 go to en.wikipedia.org not en.m.wikipedia.org. This is probably due to MediaWiki\OutputTransform\Stages\ExpandToAbsoluteUrls, which Parsoid uses by default and legacy doesn't -- but that stage just calls Linker::expandLocalLinks which uses wfExpandUrl so there is perhaps something wrong with how MFE is setting up the hostname?

Event Timeline

This is probably due to MediaWiki\OutputTransform\Stages\ExpandToAbsoluteUrls, which Parsoid uses by default and legacy doesn't -- but that stage just calls Linker::expandLocalLinks which uses wfExpandUrl so there is perhaps something wrong with how MFE is setting up the hostname?

It looks like ExpandToAbsoluteUrls runs based on whether absoluteURLs is set, and there's no Parsoid distinction. However, an earlier stage, ExtractBody, which is Parsoid only, has its own expandRelativeAttrs that it runs using the $baseHref that is extracted from the head of the document. Parsoid gets that from SiteConfig::baseURI() which pulls it from MainConfigNames::Server.

ABreault-WMF triaged this task as Medium priority.
ABreault-WMF added a subscriber: ovasileva.

Change #1037106 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/core@master] [WIP] Get mobile url for Parsoid's basehref

https://gerrit.wikimedia.org/r/1037106

Change #1037106 merged by jenkins-bot:

[mediawiki/core@master] Get mobile url for Parsoid's baseHref

https://gerrit.wikimedia.org/r/1037106

The links on the example page now go to en.m.wikipedia.org