diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 21:29:52 +0200 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 21:29:52 +0200 |
| commit | 3b71e81cfba726043063b05cb793e18186143252 (patch) | |
| tree | 3cd21125fa22e33082d2fc30b2bcd70639369ced /phpBB/includes/avatar/manager.php | |
| parent | 81fb4268cd141259fe5b3bc9ad51adf2e29e0772 (diff) | |
| download | forums-3b71e81cfba726043063b05cb793e18186143252.tar forums-3b71e81cfba726043063b05cb793e18186143252.tar.gz forums-3b71e81cfba726043063b05cb793e18186143252.tar.bz2 forums-3b71e81cfba726043063b05cb793e18186143252.tar.xz forums-3b71e81cfba726043063b05cb793e18186143252.zip | |
[feature/avatars] Simplify clean_row, move it to avatar manager
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/avatar/manager.php')
| -rw-r--r-- | phpBB/includes/avatar/manager.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/avatar/manager.php b/phpBB/includes/avatar/manager.php index 41429f3a06..054bb0cee9 100644 --- a/phpBB/includes/avatar/manager.php +++ b/phpBB/includes/avatar/manager.php @@ -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); + } } |
