From 9bdb88879da75e31883817f42b2f1f8ea54f3626 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 4 Mar 2025 09:53:19 +0700 Subject: [PATCH] [ticket/17480] Properly catch RuntimeException if no http handler is available PHPBB-17480 --- phpBB/phpbb/file_downloader.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index 0dcb3e5854..3f87c9c512 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -75,8 +75,15 @@ class file_downloader */ public function get(string $host, string $directory, string $filename, int $port = 443, int $timeout = 6) { - // Initialize Guzzle client - $client = $this->create_client($host, $port, $timeout); + try + { + // Initialize Guzzle client + $client = $this->create_client($host, $port, $timeout); + } + catch (\RuntimeException $exception) + { + throw new runtime_exception($exception->getMessage()); + } // Set default values for error variables $this->error_number = 0;