aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/avatar
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-15 15:22:39 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-17 12:56:04 +0100
commite6aaef6066549696453063417167e5a79c53b353 (patch)
tree35d9101ff8f27ddfe35fcfcebf10cd21b0aacdc9 /phpBB/includes/avatar
parent2f47c99432c604a2adaad73821602a4b1763caa8 (diff)
downloadforums-e6aaef6066549696453063417167e5a79c53b353.tar
forums-e6aaef6066549696453063417167e5a79c53b353.tar.gz
forums-e6aaef6066549696453063417167e5a79c53b353.tar.bz2
forums-e6aaef6066549696453063417167e5a79c53b353.tar.xz
forums-e6aaef6066549696453063417167e5a79c53b353.zip
[feature/avatars] Use callback method in avatar manager's clean row
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/avatar')
-rw-r--r--phpBB/includes/avatar/manager.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/phpBB/includes/avatar/manager.php b/phpBB/includes/avatar/manager.php
index 2789158de5..f5c93a6328 100644
--- a/phpBB/includes/avatar/manager.php
+++ b/phpBB/includes/avatar/manager.php
@@ -157,18 +157,23 @@ class phpbb_avatar_manager
$keys = array_keys($row);
$values = array_values($row);
- $keys = array_map(
- function ($key)
- {
- return preg_replace('#^(?:user_|group_)#', '', $key);
- },
- $keys
- );
+ $keys = array_map(array('phpbb_avatar_manager', 'strip_prefix'), $keys);
return array_combine($keys, $values);
}
/**
+ * Strip prepending user_ or group_ prefix from key
+ *
+ * @param string Array key
+ * @return string Key that has been stripped from its prefix
+ */
+ protected static function strip_prefix($key)
+ {
+ return preg_replace('#^(?:user_|group_)#', '', $key);
+ }
+
+ /**
* Clean driver names that are returned from template files
* Underscores are replaced with dots
*