1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-07 16:15:22 +02:00

[feature/avatars] Implement better treatment of avatar errors

PHPBB3-10018
This commit is contained in:
Marc Alexander 2012-11-25 17:01:21 +01:00
parent f8256ed00f
commit a77fcdb5f9
4 changed files with 21 additions and 25 deletions

View File

@ -559,16 +559,16 @@ class acp_groups
* Merge any avatar errors into the primary error array
* Drivers use language constants, so we need to map to the actual strings
*/
foreach ($avatar_error as $e)
foreach ($avatar_error as $lang)
{
if (is_array($e))
if (is_array($lang))
{
$key = array_shift($e);
$error[] = vsprintf($user->lang($key), $e);
$key = array_shift($lang);
$error[] = vsprintf($user->lang($key), $lang);
}
else
{
$error[] = $user->lang("$e");
$error[] = $user->lang("$lang");
}
}

View File

@ -1836,21 +1836,19 @@ class acp_users
}
// Replace "error" strings with their real, localised form
$err = $error;
$error = array();
foreach ($err as $e)
foreach ($error as $key => $lang)
{
if (is_array($e))
if (is_array($lang))
{
$key = array_shift($e);
$error[] = vsprintf($user->lang($key), $e);
$lang_key = array_shift($lang);
$error[$key] = vsprintf($user->lang($lang_key), $lang);
}
else
{
$error[] = $user->lang((string) $e);
$error[$key] = $user->lang("$lang");
}
}
$avatar = get_user_avatar($user_row, 'USER_AVATAR', true);
$template->assign_vars(array(

View File

@ -679,16 +679,16 @@ class ucp_groups
// Merge any avatars errors into the primary error array
// Drivers use lang constants, so we need to map to the actual strings
foreach ($avatar_error as $e)
foreach ($avatar_error as $lang)
{
if (is_array($e))
if (is_array($lang))
{
$key = array_shift($e);
$error[] = vsprintf($user->lang($key), $e);
$key = array_shift($lang);
$error[] = vsprintf($user->lang($key), $lang);
}
else
{
$error[] = $user->lang((string) $e);
$error[] = $user->lang("$lang");
}
}

View File

@ -656,18 +656,16 @@ class ucp_profile
}
// Replace "error" strings with their real, localised form
$err = $error;
$error = array();
foreach ($err as $e)
foreach ($error as $key => $lang)
{
if (is_array($e))
if (is_array($lang))
{
$key = array_shift($e);
$error[] = vsprintf($user->lang($key), $e);
$key = array_shift($lang);
$error[$key] = vsprintf($user->lang($key), $lang);
}
else
{
$error[] = $user->lang((string) $e);
$error[$key] = $user->lang("$lang");
}
}