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.
crunchydillpickle | |
Feb 20 2024, 5:51 PM |
F42005027: IMG_6663.jpg | |
Feb 20 2024, 5:51 PM |
Hello! My friend and I both had this bug.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Don't interpret "0" title as falsy | mediawiki/core | master | +13 -3 |
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.
This looks like parsoid specific:
@cscott any ideas? I vaguely remember we've discussed this before.
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
Change 1005558 merged by jenkins-bot:
[mediawiki/core@master] Don't interpret "0" title as falsy