]> git.mxchange.org Git - friendica.git/commitdiff
i18n ru intval bug
authorAlexandre Alapetite <alexandre@alapetite.fr>
Thu, 17 May 2018 05:57:55 +0000 (07:57 +0200)
committerAlexandre Alapetite <alexandre@alapetite.fr>
Thu, 17 May 2018 05:57:55 +0000 (07:57 +0200)
Should fix: Got error 'PHP message: PHP Warning:  A non-numeric value
encountered in /home/alex/public_html/f.a80.fr/view/lang/ru/strings.php
on line 5\n

PHP 7.2.5 / Ubuntu 18.04 LTS

view/lang/ru/strings.php

index 27aa61a1a5d044c2644d40bb5ce038d9c4a66b3e..c65b8aba2a9267a8a1097d23bdc356780347f6f1 100644 (file)
@@ -2,6 +2,7 @@
 
 if(! function_exists("string_plural_select_ru")) {
 function string_plural_select_ru($n){
+       $n = intval($n);
        return ($n%10==1 && $n%100!=11 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);;
 }}
 ;