1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 21:54:00 +02:00

[feature/avatars] Use request object in avatar drivers

PHPBB3-10018
This commit is contained in:
Igor Wiedler
2012-04-07 19:19:13 +02:00
parent 3b0e0dba32
commit e861bb0e04
9 changed files with 33 additions and 21 deletions

View File

@@ -50,8 +50,8 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
public function prepare_form($template, $row, &$error)
{
$template->assign_vars(array(
'AV_REMOTE_WIDTH' => (($row['avatar_type'] == AVATAR_REMOTE || $row['avatar_type'] == 'remote') && $row['avatar_width']) ? $row['avatar_width'] : request_var('av_local_width', 0),
'AV_REMOTE_HEIGHT' => (($row['avatar_type'] == AVATAR_REMOTE || $row['avatar_type'] == 'remote') && $row['avatar_height']) ? $row['avatar_height'] : request_var('av_local_width', 0),
'AV_REMOTE_WIDTH' => (($row['avatar_type'] == AVATAR_REMOTE || $row['avatar_type'] == 'remote') && $row['avatar_width']) ? $row['avatar_width'] : $this->request->variable('av_local_width', 0),
'AV_REMOTE_HEIGHT' => (($row['avatar_type'] == AVATAR_REMOTE || $row['avatar_type'] == 'remote') && $row['avatar_height']) ? $row['avatar_height'] : $this->request->variable('av_local_width', 0),
'AV_REMOTE_URL' => (($row['avatar_type'] == AVATAR_REMOTE || $row['avatar_type'] == 'remote') && $row['avatar']) ? $row['avatar'] : '',
));
@@ -63,10 +63,10 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
*/
public function process_form($template, $row, &$error)
{
$url = request_var('av_remote_url', '');
$width = request_var('av_remote_width', 0);
$height = request_var('av_remote_height', 0);
$url = $this->request->variable('av_remote_url', '');
$width = $this->request->variable('av_remote_width', 0);
$height = $this->request->variable('av_remote_height', 0);
if (!preg_match('#^(http|https|ftp)://#i', $url))
{
$url = 'http://' . $url;