diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2013-11-10 14:25:58 -0800 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2013-11-10 14:25:58 -0800 |
| commit | 4468525ee3a6d6621292268912de539c22a04124 (patch) | |
| tree | 76e117a5a69a4ca2e29c5c27908e0859b361a97c /phpBB | |
| parent | 9d4d212e0f71789e1f0332046dd852d80ab9c8ba (diff) | |
| parent | aa84f7de04b0efdf871d75694aee60e5ecf37f56 (diff) | |
| download | forums-4468525ee3a6d6621292268912de539c22a04124.tar forums-4468525ee3a6d6621292268912de539c22a04124.tar.gz forums-4468525ee3a6d6621292268912de539c22a04124.tar.bz2 forums-4468525ee3a6d6621292268912de539c22a04124.tar.xz forums-4468525ee3a6d6621292268912de539c22a04124.zip | |
Merge pull request #2 from nickvergessen/marc/ticket/11525
Marc/ticket/11525
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/phpbb/avatar/manager.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index f2bb1a5dbe..9f6a5fb089 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -180,11 +180,12 @@ class manager /** * Strip out user_, group_, or other prefixes from array keys * - * @param array $row User data or group data - * @param string $prefix Prefix of data keys + * @param array $row User data or group data + * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore * - * @return array User data or group data with keys that have been - * stripped from the preceding "user_" or "group_" + * @return array User or group data with keys that have been + * stripped from the preceding "user_" or "group_" + * Also the group id is prefixed with g, when the prefix group is removed. */ static public function clean_row($row, $prefix = '') { @@ -198,15 +199,24 @@ class manager $values = array_values($row); array_walk($keys, array('\phpbb\avatar\manager', 'strip_prefix'), $prefix); + $row = array_combine($keys, $values); - return array_combine($keys, $values); + if ($prefix == 'group') + { + $row['id'] = 'g' . $row['id']; + } + + return $row; } /** * Strip prepending user_ or group_ prefix from key * - * @param string Array key - * @return void + * @param string $key Array key + * @param string $null Parameter is ignored by the function, just required by the array_walk + * @param string $prefix Prefix that should be stripped off from the keys (e.g. user) + * Should not include the trailing underscore + * @return null */ static protected function strip_prefix(&$key, $null, $prefix) { |
