1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/avatars] Simplify clean_row, move it to avatar manager

PHPBB3-10018
This commit is contained in:
Igor Wiedler
2012-04-08 21:29:52 +02:00
parent 81fb4268cd
commit 3b71e81cfb
7 changed files with 24 additions and 57 deletions

View File

@@ -125,4 +125,23 @@ class phpbb_avatar_manager
return array_keys(self::$valid_drivers);
}
/**
* Strip out user_ and group_ prefixes from keys
**/
public static function clean_row($row)
{
$keys = array_keys($row);
$values = array_values($row);
$keys = array_map(
function ($key)
{
return preg_replace('(user_|group_)', '', $key);
},
$row
);
return array_combine($keys, $values);
}
}