1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 06:38:43 +01:00

[ticket/16787] Properly check if fsockopen() is enabled - PHP 8

PHPBB3-16787
This commit is contained in:
3D-I 2021-05-29 21:12:07 +02:00
parent f007aef3d8
commit e2cfc01964

View File

@ -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");