Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist
authorEdward Chernenko <edwardspec@gmail.com>
Sun, 1 Jul 2018 02:10:56 +0000 (05:10 +0300)
committerEdward Chernenko <edwardspec@gmail.com>
Tue, 10 Jul 2018 00:05:34 +0000 (00:05 +0000)
commit96998d51f9788b0397c93b00a4ebfcfd4ed85c54
treed845bc4c0e5c7be01ec17cc11745efd260947a83
parent9604c55869b0879f944215eda992570820b55ec8
Avoid arithmetics on localized number string ("0,04") in SpecialWatchlist

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

This "0,04" is then used in arithmetic operations, where it's treated as 0,
resulting in "0 hours" being shown instead of "1 hour", "2 hours", etc.

Bug: T198501
Change-Id: Iaa4e6170b30a7bb9ce0f22d9d2cc4772b0faa3b8
(cherry picked from commit 6b240c699eb1e965dad3c51107566f1f27ed1887)
includes/specials/SpecialWatchlist.php