Skip to content
Snippets Groups Projects
Commit 40cb28d7 authored by enured's avatar enured
Browse files

B16478: Fixed stream_get_contents failure in PHP8.1 Generic Error. refs #16478

parent 1e1b7ce3
No related branches found
No related tags found
2 merge requests!598New version v23.6.3,!597B16478: Fixed stream_get_contents failure in PHP8.1 Generic Error. refs #16478
Pipeline #9776 passed
...@@ -192,13 +192,14 @@ class RestClient { ...@@ -192,13 +192,14 @@ class RestClient {
$context = stream_context_create($opts); $context = stream_context_create($opts);
$stream = @fopen($url, 'r', false, $context); $stream = @fopen($url, 'r', false, $context);
$output = stream_get_contents($stream);
if ($stream === false) { if ($stream === false) {
$err = error_get_last(); $err = error_get_last();
throw new Exception("Api call {$method} {$url} failed: " . $err['message'], ERROR_REST_API_CALL); throw new Exception("Api call {$method} {$url} failed: " . $err['message'], ERROR_REST_API_CALL);
} }
$output = stream_get_contents($stream);
// get HTTP status code // get HTTP status code
$status_line = $http_response_header[0]; $status_line = $http_response_header[0];
preg_match('{HTTP\/\S*\s(\d{3})}', $status_line, $match); preg_match('{HTTP\/\S*\s(\d{3})}', $status_line, $match);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment