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

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

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

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

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