From e2cfc019645abc8b71014d6d9888fc2443a4fcc0 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 29 May 2021 21:12:07 +0200 Subject: [PATCH 1/2] [ticket/16787] Properly check if fsockopen() is enabled - PHP 8 PHPBB3-16787 --- phpBB/phpbb/file_downloader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index 403ca5bc83..bd20e021b2 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -42,7 +42,9 @@ class file_downloader $this->error_number = 0; $this->error_string = ''; - if ($socket = @fsockopen(($port == 443 ? 'ssl://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout)) + if (function_exists('fsockopen') && + $socket = fsockopen(($port == 443 ? 'ssl://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout) + ) { @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n"); @fputs($socket, "HOST: $host\r\n"); From c5ec036b84b6edbabeb824ecc0aca9ab98191082 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 29 May 2021 21:53:11 +0200 Subject: [PATCH 2/2] [ticket/16787] Properly check if fsockopen() is enabled - PHP 8 PHPBB3-16787 --- phpBB/phpbb/file_downloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index bd20e021b2..f55b825d2d 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -43,7 +43,7 @@ class file_downloader $this->error_string = ''; if (function_exists('fsockopen') && - $socket = fsockopen(($port == 443 ? 'ssl://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout) + $socket = @fsockopen(($port == 443 ? 'ssl://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout) ) { @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n");