1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[feature/avatars] Check for existing functions rather than using _once

PHPBB3-10018
This commit is contained in:
Marc Alexander
2012-11-26 23:06:38 +01:00
parent 0abec06b09
commit cb1d98ab7f
4 changed files with 21 additions and 5 deletions

View File

@@ -82,7 +82,10 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
$url = 'http://' . $url;
}
require_once($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
if (!function_exists('user_add'))
{
require($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
}
$error = array_merge($error, validate_data(array(
'url' => $url,
@@ -128,7 +131,11 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
return false;
}
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
if (!class_exists('fileupload'))
{
include_once($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
}
$types = fileupload::image_types();
$extension = strtolower(filespec::get_extension($url));