aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-11-25 17:01:21 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-11-25 17:01:21 +0100
commita77fcdb5f93ed291c223c445a46a5641cfdb27ea (patch)
tree1c5e476fd10fc1073b5f5214b034f1597a9fbe12 /phpBB/includes
parentf8256ed00f5ecc95fbf9f69fd2e8de2a92bccec6 (diff)
downloadforums-a77fcdb5f93ed291c223c445a46a5641cfdb27ea.tar
forums-a77fcdb5f93ed291c223c445a46a5641cfdb27ea.tar.gz
forums-a77fcdb5f93ed291c223c445a46a5641cfdb27ea.tar.bz2
forums-a77fcdb5f93ed291c223c445a46a5641cfdb27ea.tar.xz
forums-a77fcdb5f93ed291c223c445a46a5641cfdb27ea.zip
[feature/avatars] Implement better treatment of avatar errors
PHPBB3-10018
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_groups.php10
-rw-r--r--phpBB/includes/acp/acp_users.php14
-rw-r--r--phpBB/includes/ucp/ucp_groups.php10
-rw-r--r--phpBB/includes/ucp/ucp_profile.php12
4 files changed, 21 insertions, 25 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index a55087adce..19006df306 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -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");
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 823f001fe0..e0dcea6d58 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -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(
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index dd03f332ff..3860d22917 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -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");
}
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 88820beac1..c05105eaff 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -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");
}
}