From 00a1a52bf91d62f05b29a42ccc2f8925f20a81e1 Mon Sep 17 00:00:00 2001 From: Roland Dalmulder Date: Mon, 16 Dec 2024 14:04:52 +0100 Subject: [PATCH] [#43505] Fixed not reading the changelog URL Signed-off-by: Roland Dalmulder --- libraries/src/Changelog/Changelog.php | 2 +- libraries/src/Http/Transport/CurlTransport.php | 1 + libraries/src/Http/Transport/SocketTransport.php | 1 + libraries/src/Http/Transport/StreamTransport.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/src/Changelog/Changelog.php b/libraries/src/Changelog/Changelog.php index ef21696991ab0..c0536c77a9600 100644 --- a/libraries/src/Changelog/Changelog.php +++ b/libraries/src/Changelog/Changelog.php @@ -372,7 +372,7 @@ public function loadFromXml($url) xml_set_element_handler($this->xmlParser, 'startElement', 'endElement'); xml_set_character_data_handler($this->xmlParser, 'characterData'); - if (!xml_parse($this->xmlParser, $response->body)) { + if (!xml_parse($this->xmlParser, $response->getBody()->getContents())) { Log::add( \sprintf( 'XML error: %s at line %d', diff --git a/libraries/src/Http/Transport/CurlTransport.php b/libraries/src/Http/Transport/CurlTransport.php index 47b3485e18593..69354049774d4 100644 --- a/libraries/src/Http/Transport/CurlTransport.php +++ b/libraries/src/Http/Transport/CurlTransport.php @@ -260,6 +260,7 @@ protected function getResponse($content, $info) $streamInterface = new StreamResponse('php://memory', 'rw'); $streamInterface->write($body); + $streamInterface->rewind(); return new Response($streamInterface, $statusCode, $verifiedHeaders); } diff --git a/libraries/src/Http/Transport/SocketTransport.php b/libraries/src/Http/Transport/SocketTransport.php index 45c10da198e7a..c74ccc1e33e6e 100644 --- a/libraries/src/Http/Transport/SocketTransport.php +++ b/libraries/src/Http/Transport/SocketTransport.php @@ -176,6 +176,7 @@ protected function getResponse($content) $streamInterface = new StreamResponse('php://memory', 'rw'); $streamInterface->write($body); + $streamInterface->rewind(); return new Response($streamInterface, $statusCode, $verifiedHeaders); } diff --git a/libraries/src/Http/Transport/StreamTransport.php b/libraries/src/Http/Transport/StreamTransport.php index 320db7b78268c..e5b6c1280eb81 100644 --- a/libraries/src/Http/Transport/StreamTransport.php +++ b/libraries/src/Http/Transport/StreamTransport.php @@ -209,6 +209,7 @@ protected function getResponse(array $headers, $body) $streamInterface = new StreamResponse('php://memory', 'rw'); $streamInterface->write($body); + $streamInterface->rewind(); return new Response($streamInterface, $statusCode, $verifiedHeaders); }