mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-08 13:05:30 +00:00
Fix #747: Ensure string response before gzip decode
This commit is contained in:
+2
-1
@@ -2155,7 +2155,8 @@ class Curl
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($response_headers['Content-Encoding']) && $response_headers['Content-Encoding'] === 'gzip') {
|
||||
if (isset($response_headers['Content-Encoding']) && $response_headers['Content-Encoding'] === 'gzip' &&
|
||||
is_string($response)) {
|
||||
// Use @ to suppress message "Warning gzdecode(): data error".
|
||||
$decoded_response = @gzdecode($response);
|
||||
if ($decoded_response !== false) {
|
||||
|
||||
Reference in New Issue
Block a user