1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge remote-tracking branch 'remotes/Marc/ticket/11404' into develop

# By Marc Alexander
# Via Marc Alexander
* remotes/Marc/ticket/11404:
  [ticket/11404] Remove version ID from manager_test.php file header
  [ticket/11404] Add tests for phpbb_avatar_manager::clean_row()
  [ticket/11404] Convert manager_test to UNIX line endings
  [ticket/11404] Use a default data row if $row is empty in clean_row()
  [ticket/11404] Return empty array of avatar data if $row is empty
This commit is contained in:
Nathan Guse
2013-03-12 14:48:07 -05:00
2 changed files with 177 additions and 90 deletions

View File

@@ -45,6 +45,17 @@ class phpbb_avatar_manager
*/
protected $container;
/**
* Default avatar data row
* @var array
*/
static protected $default_row = array(
'avatar' => '',
'avatar_type' => '',
'avatar_width' => '',
'avatar_height' => '',
);
/**
* Construct an avatar manager object
*
@@ -174,6 +185,12 @@ class phpbb_avatar_manager
*/
static public function clean_row($row)
{
// Upon creation of a user/group $row might be empty
if (empty($row))
{
return self::$default_row;
}
$keys = array_keys($row);
$values = array_values($row);