mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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
1 changed files with 11 additions and 0 deletions
|
@ -177,6 +177,17 @@ class phpbb_avatar_manager
|
||||||
$keys = array_keys($row);
|
$keys = array_keys($row);
|
||||||
$values = array_values($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);
|
$keys = array_map(array('phpbb_avatar_manager', 'strip_prefix'), $keys);
|
||||||
|
|
||||||
return array_combine($keys, $values);
|
return array_combine($keys, $values);
|
||||||
|
|
Loading…
Add table
Reference in a new issue