Skip to content

Commit 7088b40

Browse files
committed
Fix php-curl-class#183: Fix "Function name must be callable" warning
1 parent c6ea53b commit 7088b40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,9 @@ private function parseResponse($response_headers, $raw_response)
837837
if (isset($response_headers['Content-Type'])) {
838838
if (preg_match($this->json_pattern, $response_headers['Content-Type'])) {
839839
$json_decoder = $this->json_decoder;
840-
$response = $json_decoder($response);
840+
if (is_callable($json_decoder)) {
841+
$response = $json_decoder($response);
842+
}
841843
} elseif (preg_match($this->xml_pattern, $response_headers['Content-Type'])) {
842844
$xml_obj = @simplexml_load_string($response);
843845
if (!($xml_obj === false)) {

0 commit comments

Comments
 (0)