From a04af20806c858f6acb76103b5ee516ecd5f0ffc Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 29 Sep 2023 21:34:27 +0200 Subject: [PATCH] [ticket/17198] Use https instead of http as default in remote avatar PHPBB3-17198 --- phpBB/phpbb/avatar/driver/remote.php | 2 +- tests/avatar/manager_test.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index b16549ffb7..444f35ccf3 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -62,7 +62,7 @@ class remote extends \phpbb\avatar\driver\driver if (!preg_match('#^(http|https|ftp)://#i', $url)) { - $url = 'http://' . $url; + $url = 'https://' . $url; } if (!function_exists('validate_data')) diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 3e71150f1f..dbcf6dae7e 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -27,7 +27,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case protected function setUp(): void { - global $phpbb_root_path, $phpEx; + global $phpbb_dispatcher, $phpbb_root_path, $phpEx; // Mock phpbb_container $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); @@ -60,6 +60,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case $imagesize = new \FastImageSize\FastImageSize(); $dispatcher = new phpbb_mock_event_dispatcher(); + $phpbb_dispatcher = $dispatcher; // $this->avatar_foobar will be needed later on $this->avatar_foobar = $this->getMockBuilder('\phpbb\avatar\driver\foobar')