diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-03-06 11:32:23 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-03-06 11:32:23 +0100 |
commit | 5963905825ed65a522fe94e380c6c179a461e437 (patch) | |
tree | 328f054764a1669826372f2e8f3eb5dca8f0cc63 | |
parent | 597c16a9363858e343480f70b1852bce2bba5ca3 (diff) | |
download | forums-5963905825ed65a522fe94e380c6c179a461e437.tar forums-5963905825ed65a522fe94e380c6c179a461e437.tar.gz forums-5963905825ed65a522fe94e380c6c179a461e437.tar.bz2 forums-5963905825ed65a522fe94e380c6c179a461e437.tar.xz forums-5963905825ed65a522fe94e380c6c179a461e437.zip |
[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
-rw-r--r-- | phpBB/includes/avatar/manager.php | 11 |
1 files changed, 11 insertions, 0 deletions
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); |