Page MenuHomePhabricator

Broken links to scripts and styles on Special:Gadgets
Closed, ResolvedPublic

Description

Observed on 1.27.0-wmf.8 Wikimedia projects. An additional MediaWiki: prefix was prepended to every target link pointing to a JS script/CSS stylesheet on Special:Gadgets, resulting in page titles like MediaWiki:MediaWiki:Gadget-citations.js (see test.wikipedia.org).

Details

Related Gerrit Patches:
mediawiki/extensions/Gadgets : wmf/1.27.0-wmf.8Fix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets
mediawiki/extensions/Gadgets : masterFix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets

Event Timeline

PeterBowman raised the priority of this task from to Needs Triage.
PeterBowman updated the task description. (Show Details)
PeterBowman added a subscriber: PeterBowman.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 10 2015, 12:59 AM
Rillke added a subscriber: Rillke.Dec 10 2015, 2:50 AM

Actually, it is pre-pended and I confirm this is a regression that has been recently added.

PeterBowman updated the task description. (Show Details)Dec 10 2015, 2:59 AM
PeterBowman set Security to None.

Actually, it is pre-pended and I confirm this is a regression that has been recently added.

Oops, sorry. It's fixed now in the task description.

Aklapper triaged this task as High priority.Dec 10 2015, 11:33 AM

https://gerrit.wikimedia.org/r/228781 is responsible for this bug.

Why?

foreach ( $gadget->getScriptsAndStyles() as $codePage ) {
   $t = Title::makeTitleSafe( NS_MEDIAWIKI, $codePage );
   // ...
   $lnk[] = Linker::link( $t, htmlspecialchars( $t->getText() );

So you say $t at this point is already a botched title? This in turn would mean that $codePage is wrong?

https://gerrit.wikimedia.org/r/228781 is responsible for this bug.

Why?

I besected the problem to this change.

foreach ( $gadget->getScriptsAndStyles() as $codePage ) {
   $t = Title::makeTitleSafe( NS_MEDIAWIKI, $codePage );
   // ...
   $lnk[] = Linker::link( $t, htmlspecialchars( $t->getText() );

So you say $t at this point is already a botched title? This in turn would mean that $codePage is wrong?

I didn't analyzed the intend of the change.

Legoktm claimed this task.Dec 10 2015, 8:03 PM

Yeah, this is my fault, sorry.

https://gerrit.wikimedia.org/r/228781 is responsible for this bug.

Why?

foreach ( $gadget->getScriptsAndStyles() as $codePage ) {
   $t = Title::makeTitleSafe( NS_MEDIAWIKI, $codePage );
   // ...
   $lnk[] = Linker::link( $t, htmlspecialchars( $t->getText() );

So you say $t at this point is already a botched title? This in turn would mean that $codePage is wrong?

Yes, $t is wrong here, because $codePage already has the namespace, so it should use Title::newFromText().

Change 258204 had a related patch set uploaded (by Legoktm):
Fix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets

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

Change 258204 merged by jenkins-bot:
Fix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets

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

Change 258209 had a related patch set uploaded (by Legoktm):
Fix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets

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

Change 258209 merged by jenkins-bot:
Fix double "MediaWiki:MediaWiki:" namespace on Special:Gadgets

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

Legoktm closed this task as Resolved.Dec 10 2015, 9:49 PM

Backported and deployed.