Page MenuHomePhabricator

API code uses Linker::makeHeadline() wrong, creating incorrect HTML
Closed, ResolvedPublic

Description

API code uses Linker::makeHeadline() wrong, creating incorrect HTML. The second argument ($attribs) is apparently required to end with a '>'. There are two incorrect uses in ApiMain.php.

This is hidden by Tidy or something cleaning up the brokenness, but if you insert some var_dump in some strategic places, you'll see that we generate HTML like <div id="main/credits"></div><h3 class="apihelp-header"<span class="mw-headline" id="main.2Fcredits">Credits</span></h3> with the <h3> opening tag missing the >.

This probably shouldn't even use that weird function and just do Html::element(), like in ApiHelp.php.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 18 2017, 10:48 AM

This probably shouldn't even use that weird function and just do Html::element(), like in ApiHelp.php.

It did at one point. That was changed in rMWfd6e9ef2d481: Human-readable section ID support.

Change 398850 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiMain: Fix call to Linker::makeHeadline()

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

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Dec 18 2017, 2:55 PM

Change 398850 merged by jenkins-bot:
[mediawiki/core@master] ApiMain: Fix call to Linker::makeHeadline()

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

Anomie closed this task as Resolved.Dec 18 2017, 4:03 PM
Anomie claimed this task.

Change 398864 had a related patch set uploaded (by MaxSem; owner: Anomie):
[mediawiki/core@REL1_30] ApiMain: Fix call to Linker::makeHeadline()

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

Change 398864 merged by jenkins-bot:
[mediawiki/core@REL1_30] ApiMain: Fix call to Linker::makeHeadline()

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

Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:39 PM