Page MenuHomePhabricator

The "zero" article redirects to enwiki homepage on iOS and Android Wikipedia app
Closed, ResolvedPublicBUG REPORT

Description

Hello! My friend and I both had this bug.

  • Search "0" or "zero" on the iOS Wikipedia app
  • Arrive at the English Wikipedia homepage, instead of the wonderful Wikipedia article about the number zero.

IMG_6663.jpg (1×1 px, 239 KB)

Event Timeline

JTannerWMF triaged this task as Low priority.
JTannerWMF moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.
JTannerWMF subscribed.

Will investigate this

This smells like PHP seeing "0" and evaluating it as boolean false, a common error when intending to test for non-empty strings. (PHP's coercion rules evaluate "0" as the number 0, which then evaluates to a boolean false, when it's used as a bare condition.)

The API endpoint that the app is hitting may be doing such a test and sending you to the main page by accident because it thinks no title was provided.

Seddon renamed this task from The "zero" article redirects to enwiki homepage on iOS Wikipedia app to The "zero" article redirects to enwiki homepage on iOS and Android Wikipedia app .Feb 21 2024, 3:50 PM

This looks like parsoid specific:

@cscott any ideas? I vaguely remember we've discussed this before.

NOTE: This is not a redirect, it actually renders Main_Page
Arlolra added subscribers: Seddon, Arlolra.

This smells like PHP seeing "0" and evaluating it as boolean false

$title = $title ? Title::newFromText( $title ) : Title::newMainPage();
https://github.com/wikimedia/mediawiki/blob/master/includes/Rest/Handler/ParsoidHandler.php#L504

Change 1005558 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/core@master] Don't interpret "0" title as falsy

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

Change 1005558 merged by jenkins-bot:

[mediawiki/core@master] Don't interpret "0" title as falsy

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