-
diff --git a/phpBB/config/default/container/services_avatar.yml b/phpBB/config/default/container/services_avatar.yml
index 89dbb2e0bf..4f542c61a2 100644
--- a/phpBB/config/default/container/services_avatar.yml
+++ b/phpBB/config/default/container/services_avatar.yml
@@ -52,20 +52,6 @@ services:
tags:
- { name: avatar.driver }
- avatar.driver.remote:
- class: phpbb\avatar\driver\remote
- arguments:
- - '@config'
- - '@upload_imagesize'
- - '%core.root_path%'
- - '%core.php_ext%'
- - '@path_helper'
- - '@cache.driver'
- calls:
- - [set_name, [avatar.driver.remote]]
- tags:
- - { name: avatar.driver }
-
avatar.driver.upload:
class: phpbb\avatar\driver\upload
arguments:
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index d93327657a..bfb058ba03 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -267,7 +267,6 @@ class phpbb_questionnaire_phpbb_data_provider
'allow_autologin' => true,
'allow_avatar' => true,
'allow_avatar_local' => true,
- 'allow_avatar_remote' => true,
'allow_avatar_upload' => true,
'allow_bbcode' => true,
'allow_birthdays' => true,
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 50518b7b3b..62294bf449 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -115,7 +115,6 @@ $config_schema = array(
'allow_sig' => 'allow_sig',
'allow_namechange' => 'allow_namechange',
'allow_avatar_local' => 'allow_avatar_local',
- 'allow_avatar_remote' => 'allow_avatar_remote',
'allow_avatar_upload' => 'allow_avatar_upload',
'board_disable' => 'board_disable',
'sitename' => 'phpbb_set_encoding(sitename)',
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index b835dff45a..aee9644c2a 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -11,8 +11,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1');
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index d209ee3d08..3f1a1b52f1 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -106,16 +106,12 @@ $lang = array_merge($lang, array(
// Avatar Settings
$lang = array_merge($lang, array(
- 'ACP_AVATAR_SETTINGS_EXPLAIN' => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that file size limits are only imposed on uploaded avatars, they do not apply to remotely linked images.',
+ 'ACP_AVATAR_SETTINGS_EXPLAIN' => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server.',
'ALLOW_AVATARS' => 'Enable avatars',
'ALLOW_AVATARS_EXPLAIN' => 'Allow general usage of avatars; If you disable avatars in general or avatars of a certain mode, the disabled avatars will no longer be shown on the board, but users will still be able to download their own avatars in the User Control Panel.',
'ALLOW_GRAVATAR' => 'Enable gravatar avatars',
'ALLOW_LOCAL' => 'Enable gallery avatars',
- 'ALLOW_REMOTE' => 'Enable remote avatars',
- 'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website. Warning: Enabling this feature might allow users to check for the existence of files and services that are only accessible on the local network.',
- 'ALLOW_REMOTE_UPLOAD' => 'Enable remote avatar uploading',
- 'ALLOW_REMOTE_UPLOAD_EXPLAIN' => 'Allow uploading of avatars from another website. Warning: Enabling this feature might allow users to check for the existence of files and services that are only accessible on the local network.',
'ALLOW_UPLOAD' => 'Enable avatar uploading',
'AVATAR_GALLERY_PATH' => 'Avatar gallery path',
'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root directory for pre-loaded images, e.g. images/avatars/gallery. Double dots like ../ will be stripped from the path for security reasons.',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 9f31f87078..24fd293326 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -105,7 +105,6 @@ $lang = array_merge($lang, array(
'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED' => 'OAuth token incorrectly stored.',
'AVATAR_DISALLOWED_CONTENT' => 'The upload was rejected because the uploaded file was identified as a possible attack vector.',
'AVATAR_DISALLOWED_EXTENSION' => 'This file cannot be displayed because the extension %s is not allowed.',
- 'AVATAR_EMPTY_REMOTE_DATA' => 'The specified avatar could not be uploaded because the remote data appears to be invalid or corrupted.',
'AVATAR_EMPTY_FILEUPLOAD' => 'The uploaded avatar file is empty.',
'AVATAR_INVALID_FILENAME' => '%s is an invalid filename.',
'AVATAR_NOT_UPLOADED' => 'Avatar could not be uploaded.',
@@ -114,7 +113,6 @@ $lang = array_merge($lang, array(
'AVATAR_PARTIAL_UPLOAD' => 'The specified file was only partially uploaded.',
'AVATAR_PHP_SIZE_NA' => 'The avatar’s filesize is too large. The maximum allowed filesize set in php.ini could not be determined.',
'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar’s filesize is too large. The maximum allowed upload size is %1$d %2$s. Please note this is set in php.ini and cannot be overridden.',
- 'AVATAR_REMOTE_UPLOAD_TIMEOUT' => 'The specified avatar could not be uploaded because the request timed out.',
'AVATAR_PHP_UPLOAD_STOPPED' => 'A PHP extension has stopped the file upload.',
'AVATAR_URL_INVALID' => 'The URL you specified is invalid.',
'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.',
diff --git a/phpBB/language/en/help/faq.php b/phpBB/language/en/help/faq.php
index 6b165da0f8..175f9eb164 100644
--- a/phpBB/language/en/help/faq.php
+++ b/phpBB/language/en/help/faq.php
@@ -166,7 +166,7 @@ $lang = array_merge($lang, array(
'HELP_FAQ_SEARCH_OWN_QUESTION' => 'How can I find my own posts and topics?',
'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER' => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually larger, image is known as an avatar and is generally unique or personal to each user.',
- 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => 'Within your User Control Panel, under “Profile” you can add an avatar by using one of the four following methods: Gravatar, Gallery, Remote or Upload. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator.',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => 'Within your User Control Panel, under “Profile” you can add an avatar by using one of the four following methods: Gravatar, Gallery or Upload. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator.',
'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => 'How do I display an avatar?',
'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => 'What are the images next to my username?',
'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER' => 'If you are a registered user, all your settings are stored in the board database. To alter them, visit your User Control Panel; a link can usually be found by clicking on your username at the top of board pages. This system will allow you to change all your settings and preferences.',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index cd5e125831..446f357f5d 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -96,8 +96,6 @@ $lang = array_merge($lang, array(
'AVATAR_DRIVER_GRAVATAR_EXPLAIN'=> 'Gravatar is a service that allows you to maintain the same avatar across multiple websites. Visit Gravatar for more information.',
'AVATAR_DRIVER_LOCAL_TITLE' => 'Gallery avatar',
'AVATAR_DRIVER_LOCAL_EXPLAIN' => 'You can choose your avatar from a locally available set of avatars.',
- 'AVATAR_DRIVER_REMOTE_TITLE' => 'Remote avatar',
- 'AVATAR_DRIVER_REMOTE_EXPLAIN' => 'Link to avatar images from another website.',
'AVATAR_DRIVER_UPLOAD_TITLE' => 'Upload avatar',
'AVATAR_DRIVER_UPLOAD_EXPLAIN' => 'Upload your own custom avatar.',
'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.',
@@ -279,10 +277,6 @@ $lang = array_merge($lang, array(
'JOIN_SELECTED' => 'Join selected',
'LANGUAGE' => 'Language',
- 'LINK_REMOTE_AVATAR' => 'Link off-site',
- 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the avatar image you wish to link to.',
- 'LINK_REMOTE_SIZE' => 'Avatar dimensions',
- 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel.',
'LOGIN_LINK' => 'Link or register your account on an external service with your board account',
'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on this board. You must now either link this account to an existing account or create a new account.',
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
deleted file mode 100644
index b16549ffb7..0000000000
--- a/phpBB/phpbb/avatar/driver/remote.php
+++ /dev/null
@@ -1,236 +0,0 @@
-
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\avatar\driver;
-
-/**
-* Handles avatars hosted remotely
-*/
-class remote extends \phpbb\avatar\driver\driver
-{
- /**
- * {@inheritdoc}
- */
- public function get_data($row)
- {
- return array(
- 'src' => $row['avatar'],
- 'width' => $row['avatar_width'],
- 'height' => $row['avatar_height'],
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function prepare_form($request, $template, $user, $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'] : $request->variable('avatar_remote_width', ''),
- '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', ''),
- 'AVATAR_REMOTE_URL' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar']) ? $row['avatar'] : '',
- ));
-
- return true;
- }
-
- /**
- * {@inheritdoc}
- */
- public function process_form($request, $template, $user, $row, &$error)
- {
- global $phpbb_dispatcher;
-
- $url = $request->variable('avatar_remote_url', '');
- $width = $request->variable('avatar_remote_width', 0);
- $height = $request->variable('avatar_remote_height', 0);
-
- if (empty($url))
- {
- return false;
- }
-
- 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;
- }
-
- /**
- * Event to make custom validation of avatar upload
- *
- * @event core.ucp_profile_avatar_upload_validation
- * @var string url Image url
- * @var string width Image width
- * @var string height Image height
- * @var array error Error message array
- * @since 3.2.9-RC1
- */
- $vars = array('url', 'width', 'height', 'error');
- extract($phpbb_dispatcher->trigger_event('core.ucp_profile_avatar_upload_validation', compact($vars)));
-
- if (!empty($error))
- {
- return false;
- }
-
- // Check if this url looks alright
- // Do not allow specifying the port (see RFC 3986) or IP addresses
- if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', $this->allowed_extensions) . ')$#i', $url) ||
- preg_match('@^(http|https|ftp)://[^/:?#]+:[0-9]+[/:?#]@i', $url) ||
- preg_match('#^(http|https|ftp)://(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])#i', $url) ||
- preg_match('#^(http|https|ftp)://(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))#i', $url))
- {
- $error[] = 'AVATAR_URL_INVALID';
- return false;
- }
-
- // Get image dimensions
- if (($width <= 0 || $height <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false))
- {
- $error[] = 'UNABLE_GET_IMAGE_SIZE';
- return false;
- }
-
- if (!empty($image_data) && ($image_data['width'] <= 0 || $image_data['height'] <= 0))
- {
- $error[] = 'AVATAR_NO_SIZE';
- return false;
- }
-
- $width = ($width && $height) ? $width : $image_data['width'];
- $height = ($width && $height) ? $height : $image_data['height'];
-
- if ($width <= 0 || $height <= 0)
- {
- $error[] = 'AVATAR_NO_SIZE';
- return false;
- }
-
- $types = \phpbb\files\upload::image_types();
- $extension = strtolower(\phpbb\files\filespec::get_extension($url));
-
- // Check if this is actually an image
- if ($file_stream = @fopen($url, 'r'))
- {
- // Timeout after 1 second
- stream_set_timeout($file_stream, 1);
- // read some data to ensure headers are present
- fread($file_stream, 1024);
- $meta = stream_get_meta_data($file_stream);
-
- if (isset($meta['wrapper_data']['headers']) && is_array($meta['wrapper_data']['headers']))
- {
- $headers = $meta['wrapper_data']['headers'];
- }
- else if (isset($meta['wrapper_data']) && is_array($meta['wrapper_data']))
- {
- $headers = $meta['wrapper_data'];
- }
- else
- {
- $headers = array();
- }
-
- foreach ($headers as $header)
- {
- $header = preg_split('/ /', $header, 2);
- if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type')
- {
- if (strpos($header[1], 'image/') !== 0)
- {
- $error[] = 'AVATAR_URL_INVALID';
- fclose($file_stream);
- return false;
- }
- else
- {
- fclose($file_stream);
- break;
- }
- }
- }
- }
- else
- {
- $error[] = 'AVATAR_URL_INVALID';
- return false;
- }
-
- if (!empty($image_data) && (!isset($types[$image_data['type']]) || !in_array($extension, $types[$image_data['type']])))
- {
- if (!isset($types[$image_data['type']]))
- {
- $error[] = 'UNABLE_GET_IMAGE_SIZE';
- }
- else
- {
- $error[] = array('IMAGE_FILETYPE_MISMATCH', $types[$image_data['type']][0], $extension);
- }
-
- return false;
- }
-
- if ($this->config['avatar_max_width'] || $this->config['avatar_max_height'])
- {
- if ($width > $this->config['avatar_max_width'] || $height > $this->config['avatar_max_height'])
- {
- $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height);
- return false;
- }
- }
-
- if ($this->config['avatar_min_width'] || $this->config['avatar_min_height'])
- {
- if ($width < $this->config['avatar_min_width'] || $height < $this->config['avatar_min_height'])
- {
- $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height);
- return false;
- }
- }
-
- return array(
- 'avatar' => $url,
- 'avatar_width' => $width,
- 'avatar_height' => $height,
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function get_template_name()
- {
- return 'ucp_avatar_options_remote.html';
- }
-}
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index c0f15536ae..99de843f8f 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -90,7 +90,6 @@ class upload extends \phpbb\avatar\driver\driver
}
$template->assign_vars(array(
- 'S_UPLOAD_AVATAR_URL' => ($this->config['allow_avatar_remote_upload']) ? true : false,
'AVATAR_UPLOAD_SIZE' => $this->config['avatar_filesize'],
'AVATAR_ALLOWED_EXTENSIONS' => implode(',', preg_replace('/^/', '.', $this->allowed_extensions)),
));
@@ -120,59 +119,15 @@ class upload extends \phpbb\avatar\driver\driver
$this->config['avatar_max_height'])
->set_disallowed_content((isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
- $url = $request->variable('avatar_upload_url', '');
$upload_file = $request->file('avatar_upload_file');
- if (!empty($upload_file['name']))
- {
- $file = $upload->handle_upload('files.types.form_storage', 'avatar_upload_file');
- }
- else if (!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;
- }
-
- // Do not allow specifying the port (see RFC 3986) or IP addresses
- // remote_upload() will do its own check for allowed filetypes
- if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', $this->allowed_extensions) . ')$#i', $url) ||
- preg_match('@^(http|https|ftp)://[^/:?#]+:[0-9]+[/:?#]@i', $url) ||
- preg_match('#^(http|https|ftp)://(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])#i', $url) ||
- preg_match('#^(http|https|ftp)://(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))#i', $url))
- {
- $error[] = 'AVATAR_URL_INVALID';
- return false;
- }
-
- $file = $upload->handle_upload('files.types.remote_storage', $url);
- }
- else
+ if (empty($upload_file['name']))
{
return false;
}
+ $file = $upload->handle_upload('files.types.form_storage', 'avatar_upload_file');
+
$prefix = $this->config['avatar_salt'] . '_';
$file->clean_filename('avatar', $prefix, $row['id']);
@@ -251,7 +206,6 @@ class upload extends \phpbb\avatar\driver\driver
public function prepare_form_acp($user)
{
return array(
- 'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
);
}
diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php
index 9cbca98469..3d85964f5b 100644
--- a/phpBB/phpbb/avatar/manager.php
+++ b/phpBB/phpbb/avatar/manager.php
@@ -104,12 +104,10 @@ class manager
case AVATAR_GALLERY:
$avatar_type = 'avatar.driver.local';
break;
+
case AVATAR_UPLOAD:
$avatar_type = 'avatar.driver.upload';
break;
- case AVATAR_REMOTE:
- $avatar_type = 'avatar.driver.remote';
- break;
}
if (!isset($avatar_drivers[$avatar_type]))
diff --git a/phpBB/phpbb/db/migration/data/v400/remove_remote_avatar.php b/phpBB/phpbb/db/migration/data/v400/remove_remote_avatar.php
new file mode 100644
index 0000000000..263872ea6f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v400/remove_remote_avatar.php
@@ -0,0 +1,50 @@
+
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v400;
+
+use phpbb\db\migration\container_aware_migration;
+
+class remove_remote_avatar extends container_aware_migration
+{
+ public static function depends_on()
+ {
+ return ['\phpbb\db\migration\data\v400\dev'];
+ }
+
+ public function update_data()
+ {
+ return [
+ ['config.remove', ['allow_avatar_remote']],
+ ['config.remove', ['allow_avatar_remote_upload']],
+ ['custom', [[$this, 'remove_remote_avatars']]],
+ ];
+ }
+
+ public function remove_remote_avatars(): void
+ {
+ // Remove remote avatar from users and groups
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_avatar = '',
+ user_avatar_type = ''
+ WHERE user_avatar_type = 'avatar.driver.remote'";
+
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->table_prefix . "groups
+ SET group_avatar = '',
+ group_avatar_type = ''
+ WHERE group_avatar_type = 'avatar.driver.remote'";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
deleted file mode 100644
index 8e175623ac..0000000000
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
+++ /dev/null
@@ -1,11 +0,0 @@
-