mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/10345] Check directly whether the key to use exists
PHPBB3-10345
This commit is contained in:
parent
65e6ab5530
commit
c1311faebf
1 changed files with 17 additions and 9 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue