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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user