diff options
Diffstat (limited to 'phpBB/includes/avatar/driver')
-rw-r--r-- | phpBB/includes/avatar/driver/driver.php | 9 | ||||
-rw-r--r-- | phpBB/includes/avatar/driver/gravatar.php | 14 | ||||
-rw-r--r-- | phpBB/includes/avatar/driver/interface.php | 6 | ||||
-rw-r--r-- | phpBB/includes/avatar/driver/local.php | 10 | ||||
-rw-r--r-- | phpBB/includes/avatar/driver/remote.php | 14 | ||||
-rw-r--r-- | phpBB/includes/avatar/driver/upload.php | 8 |
6 files changed, 28 insertions, 33 deletions
diff --git a/phpBB/includes/avatar/driver/driver.php b/phpBB/includes/avatar/driver/driver.php index ab89cfbffe..d4f9139c18 100644 --- a/phpBB/includes/avatar/driver/driver.php +++ b/phpBB/includes/avatar/driver/driver.php @@ -34,12 +34,6 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface protected $config; /** - * Request object - * @var phpbb_request - */ - protected $request; - - /** * Current $phpbb_root_path * @var string */ @@ -66,10 +60,9 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface * @param string $php_ext PHP file extension * @param phpbb_cache_driver_interface $cache Cache driver */ - public function __construct(phpbb_config $config, phpbb_request $request, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null) + public function __construct(phpbb_config $config, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null) { $this->config = $config; - $this->request = $request; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; $this->cache = $cache; diff --git a/phpBB/includes/avatar/driver/gravatar.php b/phpBB/includes/avatar/driver/gravatar.php index c6bfb0d5c1..c574e23836 100644 --- a/phpBB/includes/avatar/driver/gravatar.php +++ b/phpBB/includes/avatar/driver/gravatar.php @@ -52,11 +52,11 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver /** * @inheritdoc */ - public function prepare_form($template, $row, &$error) + public function prepare_form($request, $template, $row, &$error) { $template->assign_vars(array( - 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $this->request->variable('avatar_gravatar_width', 0), - 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $this->request->variable('avatar_gravatar_width', 0), + 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', 0), + 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_gravatar_width', 0), 'AVATAR_GRAVATAR_EMAIL' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar']) ? $row['avatar'] : '', )); @@ -66,11 +66,11 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver /** * @inheritdoc */ - public function process_form($template, $row, &$error) + public function process_form($request, $template, $row, &$error) { - $row['avatar'] = $this->request->variable('avatar_gravatar_email', ''); - $row['avatar_width'] = $this->request->variable('avatar_gravatar_width', 0); - $row['avatar_height'] = $this->request->variable('avatar_gravatar_height', 0); + $row['avatar'] = $request->variable('avatar_gravatar_email', ''); + $row['avatar_width'] = $request->variable('avatar_gravatar_width', 0); + $row['avatar_height'] = $request->variable('avatar_gravatar_height', 0); if (!function_exists('validate_data')) { diff --git a/phpBB/includes/avatar/driver/interface.php b/phpBB/includes/avatar/driver/interface.php index e8f529f3c4..3c1db019f0 100644 --- a/phpBB/includes/avatar/driver/interface.php +++ b/phpBB/includes/avatar/driver/interface.php @@ -50,6 +50,7 @@ interface phpbb_avatar_driver_interface /** * Prepare form for changing the settings of this avatar * + * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row @@ -60,7 +61,7 @@ interface phpbb_avatar_driver_interface * * @return bool True if form has been successfully prepared */ - public function prepare_form($template, $row, &$error); + public function prepare_form($request, $template, $row, &$error); /** * Prepare form for changing the acp settings of this avatar @@ -74,6 +75,7 @@ interface phpbb_avatar_driver_interface /** * Process form data * + * @param phpbb_request $request Request object * @param phpbb_template $template Template object * @param array $row User data or group data that has been cleaned with * phpbb_avatar_manager::clean_row @@ -85,7 +87,7 @@ interface phpbb_avatar_driver_interface * @return array Array containing the avatar data as follows: * ['avatar'], ['avatar_width'], ['avatar_height'] */ - public function process_form($template, $row, &$error); + public function process_form($request, $template, $row, &$error); /** * Delete avatar diff --git a/phpBB/includes/avatar/driver/local.php b/phpBB/includes/avatar/driver/local.php index bef5c6d427..e49b8dd07f 100644 --- a/phpBB/includes/avatar/driver/local.php +++ b/phpBB/includes/avatar/driver/local.php @@ -36,10 +36,10 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver /** * @inheritdoc */ - public function prepare_form($template, $row, &$error) + public function prepare_form($request, $template, $row, &$error) { $avatar_list = $this->get_avatar_list(); - $category = $this->request->variable('avatar_local_cat', ''); + $category = $request->variable('avatar_local_cat', ''); foreach ($avatar_list as $cat => $null) { @@ -114,12 +114,12 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver /** * @inheritdoc */ - public function process_form($template, $row, &$error) + public function process_form($request, $template, $row, &$error) { $avatar_list = $this->get_avatar_list(); - $category = $this->request->variable('avatar_local_cat', ''); + $category = $request->variable('avatar_local_cat', ''); - $file = $this->request->variable('avatar_local_file', ''); + $file = $request->variable('avatar_local_file', ''); if (empty($category) || empty($file)) { diff --git a/phpBB/includes/avatar/driver/remote.php b/phpBB/includes/avatar/driver/remote.php index 717b73eb0c..e8f182063e 100644 --- a/phpBB/includes/avatar/driver/remote.php +++ b/phpBB/includes/avatar/driver/remote.php @@ -36,11 +36,11 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver /** * @inheritdoc */ - public function prepare_form($template, $row, &$error) + public function prepare_form($request, $template, $row, &$error) { $template->assign_vars(array( - 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $this->request->variable('avatar_remote_width', 0), - 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $this->request->variable('avatar_remote_width', 0), + 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', 0), + 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_remote_width', 0), 'AVATAR_REMOTE_URL' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar']) ? $row['avatar'] : '', )); @@ -50,11 +50,11 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver /** * @inheritdoc */ - public function process_form($template, $row, &$error) + public function process_form($request, $template, $row, &$error) { - $url = $this->request->variable('avatar_remote_url', ''); - $width = $this->request->variable('avatar_remote_width', 0); - $height = $this->request->variable('avatar_remote_height', 0); + $url = $request->variable('avatar_remote_url', ''); + $width = $request->variable('avatar_remote_width', 0); + $height = $request->variable('avatar_remote_height', 0); if (!preg_match('#^(http|https|ftp)://#i', $url)) { diff --git a/phpBB/includes/avatar/driver/upload.php b/phpBB/includes/avatar/driver/upload.php index 1bb86cf158..6e6956bfde 100644 --- a/phpBB/includes/avatar/driver/upload.php +++ b/phpBB/includes/avatar/driver/upload.php @@ -36,7 +36,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver /** * @inheritdoc */ - public function prepare_form($template, $row, &$error) + public function prepare_form($request, $template, $row, &$error) { if (!$this->can_upload()) { @@ -54,7 +54,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver /** * @inheritdoc */ - public function process_form($template, $row, &$error) + public function process_form($request, $template, $row, &$error) { if (!$this->can_upload()) { @@ -68,8 +68,8 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false)); - $url = $this->request->variable('avatar_upload_url', ''); - $upload_file = $this->request->file('avatar_upload_file'); + $url = $request->variable('avatar_upload_url', ''); + $upload_file = $request->file('avatar_upload_file'); if (!empty($upload_file['name'])) { |