Page MenuHomePhabricator

First heading is missing when page title is "0"
Closed, ResolvedPublic

Description

In

https://en.wikipedia.org/wiki/0
https://meta.wikimedia.org/wiki/0
https://test.wikipedia.org/wiki/0

the element '<h1 id="firstHeading" class="firstHeading" lang="en">' with its content (page title) is missing where it's supposed to be.

Event Timeline

whym raised the priority of this task from to Needs Triage.
whym updated the task description. (Show Details)
whym added a project: MediaWiki-General.
whym added a subscriber: whym.
Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder.

This looks like somewhere in code we're checking if Title is false, which in PHP an empty string, 0 or the string "0" are also considered false :S

So I looked around to see where this is happening, and it's not a core issue, it's a skin issue. You can confirm this by visiting https://www.mediawiki.org/wiki/0 and https://www.mediawiki.org/wiki/0?useskin=cologneblue.

Change 220501 had a related patch set uploaded (by Legoktm):
Display the page title on pages named '0'

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

Change 220502 had a related patch set uploaded (by Legoktm):
Display the page title on pages named '0'

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

Change 220502 merged by jenkins-bot:
Display the page title on pages named '0'

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

Change 220501 merged by jenkins-bot:
Display the page title on pages named '0'

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

This regresses T97891. The code shouldn't display the title for zero-length strings.

if ( isset( $this->data['title'] ) && strlen( trim( $this->data['title'] ) ) ) would maybe work better then?

Change 220745 had a related patch set uploaded (by Bartosz Dziewoński):
Don't output an empty h1 element (one more, with feeling)

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

Change 220746 had a related patch set uploaded (by Bartosz Dziewoński):
Don't output an empty h1 element (one more, with feeling)

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

Change 220746 merged by jenkins-bot:
Don't output an empty h1 element (once more, with feeling)

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

Change 220745 merged by jenkins-bot:
Don't output an empty h1 element (once more, with feeling)

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