1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[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
This commit is contained in:
Marc Alexander 2013-03-06 11:32:23 +01:00
parent 597c16a936
commit 5963905825

View File

@ -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);