1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

Merge branch 'develop' of git://github.com/phpbb/phpbb3 into develop

* 'develop' of git://github.com/phpbb/phpbb3:
  [ticket/11548] Fix test errors in groups test on develop
  [ticket/11548] Check upload avatar URL the same way as in phpBB 3.0
This commit is contained in:
Andreas Fischer
2013-07-12 21:45:30 +02:00
2 changed files with 34 additions and 7 deletions

View File

@@ -77,6 +77,32 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
}
elseif (!empty($this->config['allow_avatar_remote_upload']) && !empty($url))
{
if (!preg_match('#^(http|https|ftp)://#i', $url))
{
$url = 'http://' . $url;
}
if (!function_exists('validate_data'))
{
require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
}
$validate_array = validate_data(
array(
'url' => $url,
),
array(
'url' => array('string', true, 5, 255),
)
);
$error = array_merge($error, $validate_array);
if (!empty($error))
{
return false;
}
$file = $upload->remote_upload($url);
}
else