From 5963905825ed65a522fe94e380c6c179a461e437 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 6 Mar 2013 11:32:23 +0100 Subject: [PATCH] [ticket/11404] Return empty array of avatar data if $row is empty While creating a group in the acp, the group data ($group_row) is empty. Due to that array_combine in phpbb_avatar_manager::clean_row() will cause PHP Warnings. In addition to that the required indexes 'avatar', 'avatar_width', 'avatar_height', and 'avatar_type' won't be defined. This patch will solve that issue. PHPBB3-11404 --- phpBB/includes/avatar/manager.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpBB/includes/avatar/manager.php b/phpBB/includes/avatar/manager.php index 9c60436de8..f126d69300 100644 --- a/phpBB/includes/avatar/manager.php +++ b/phpBB/includes/avatar/manager.php @@ -177,6 +177,17 @@ class phpbb_avatar_manager $keys = array_keys($row); $values = array_values($row); + // Upon creation of a user/group $row might be empty + if (empty($keys)) + { + return array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => '', + 'avatar_height' => '', + ); + } + $keys = array_map(array('phpbb_avatar_manager', 'strip_prefix'), $keys); return array_combine($keys, $values);