mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
[ticket/10345] Check directly whether the key to use exists
PHPBB3-10345
This commit is contained in:
@@ -1886,17 +1886,25 @@ class user extends session
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$use_plural_form = $this->get_plural_form($args[$i]);
|
$use_plural_form = $this->get_plural_form($args[$i]);
|
||||||
$numbers = array_keys($lang);
|
if (isset($lang[$use_plural_form]))
|
||||||
|
|
||||||
foreach ($numbers as $num)
|
|
||||||
{
|
{
|
||||||
if ($num > $use_plural_form)
|
// The key we should use exists, so we use it.
|
||||||
{
|
$key_found = $use_plural_form;
|
||||||
// If the key we need to use does not exist, we fall back to the previous one.
|
}
|
||||||
break;
|
else
|
||||||
}
|
{
|
||||||
|
// If the key we need to use does not exist, we fall back to the previous one.
|
||||||
|
$numbers = array_keys($lang);
|
||||||
|
|
||||||
$key_found = $num;
|
foreach ($numbers as $num)
|
||||||
|
{
|
||||||
|
if ($num > $use_plural_form)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$key_found = $num;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user