Page MenuHomePhabricator

SpecialWatchlist::cutoffselector() uses localized number string ("0,04" instead of "0.04" in some locales) in calculations
Closed, ResolvedPublic

Description

In SpecialWatchlist::cutoffselector(), values like 1/24 or 6/24 are cast to string via strval(). However, in some locales (e.g. $wgShellLocale = 'ru_RU.utf8';) strval will return a localized form of the number, e.g. "0,04" instead of "0.04".

Later, when this "0,04" is used in arithmetic operations, it's treated as "0". (and PHP warning "A non well formed numeric value encountered" is shown).

T198501.png (237×311 px, 13 KB)

Event Timeline

edwardspec updated the task description. (Show Details)
edwardspec updated the task description. (Show Details)

Change 443298 had a related patch set uploaded (by Edward Chernenko; owner: Edward Chernenko):
[mediawiki/core@master] Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist

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

Change 443298 merged by jenkins-bot:
[mediawiki/core@master] Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist

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

Change 444768 had a related patch set uploaded (by Edward Chernenko; owner: Edward Chernenko):
[mediawiki/core@REL1_31] Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist

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

Change 444768 merged by jenkins-bot:
[mediawiki/core@REL1_31] Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist

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