diff options
-rw-r--r-- | phpBB/includes/session.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 401cb0d371..fcbe8aed2c 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1886,17 +1886,25 @@ class user extends session else { $use_plural_form = $this->get_plural_form($args[$i]); - $numbers = array_keys($lang); - - foreach ($numbers as $num) + if (isset($lang[$use_plural_form])) { - if ($num > $use_plural_form) + // The key we should use exists, so we use it. + $key_found = $use_plural_form; + } + else + { + // If the key we need to use does not exist, we fall back to the previous one. + $numbers = array_keys($lang); + + foreach ($numbers as $num) { - // If the key we need to use does not exist, we fall back to the previous one. - break; - } + if ($num > $use_plural_form) + { + break; + } - $key_found = $num; + $key_found = $num; + } } break; } |