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>
Fri, 6 Jul 2018 23:33:45 +0000 (02:33 +0300)
commit6b240c699eb1e965dad3c51107566f1f27ed1887
tree3d8384674e9bdd95cd6ac4b5ce19c56cc30533e8
parent8ac54ea4d3f642473a165aa7d28275bb79096510
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
includes/specials/SpecialWatchlist.php