mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 03:54:10 +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:
parent
597c16a936
commit
5963905825
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user