php-gettext extlib updated as req !88

Thanks postblue
This commit is contained in:
Mikael Nordfeldth 2016-01-28 14:40:47 +01:00
parent c459bded53
commit 10f16e4f32
1 changed files with 4 additions and 0 deletions

View File

@ -350,6 +350,10 @@ class gettext_reader {
* @return int array index of the right plural form
*/
function select_string($n) {
if (!is_int($n)) {
throw new InvalidArgumentException(
"Select_string only accepts integers: " . $n);
}
$string = $this->get_plural_forms();
$string = str_replace('nplurals',"\$total",$string);
$string = str_replace("n",$n,$string);