Page MenuHomePhabricator

Interwikis gets doubled decoded
Open, MediumPublic

Description

Using the following wikitext does not link to the same page:

[[en:testAtest]]
[[:en:testAtest]]

The first is linking to [[TestAtest]] (In the section "other languages"). The second is linking to [[Test&]] with the anchor "65;test" in normal wikipage. Looks strange.

If this is a feature, please tag this as INVALID. Thanks.


Version: 1.21.x
Severity: normal

Details

Reference
bz32926

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:58 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz32926.
bzimport added a subscriber: Unknown Object (MLST).

Umherirrender: Both links seem to create the same search results now?
Can you confirm (or explain what I'm doing wrong)?

You should not test it on en.wp, because than these are red links. Test it on de.wp or change the en: to de:

The excpeted result is, that both should link to [[Test&]] with the anchor "65;test" because only the & should be decoded and not a A

This is related to a parser rather than editing per se.

(It looks like different encoding pipelines being used somehow.)

In SkinTemplate#getLanguages, Title::newFromText is called on a string that is the result of calling Title#getFullText on a Title object that was itself created using Title::newFromText.

Since Title::newFromText performs HTML entity stripping (why??!), this means the link gets doubly decoded.

Aklapper lowered the priority of this task from High to Medium.Sep 1 2015, 12:45 PM
Aklapper subscribed.

[lowering priority - "high priority" was set in 2011 on this task and that's just not the case here.]