Skip to content

Commit a053ed7

Browse files
committed
Fix php-curl-class#543: Use original response when xml decode fails
1 parent 34c751c commit a053ed7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Curl/Decoder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public static function decodeJson()
4444
public static function decodeXml()
4545
{
4646
$args = func_get_args();
47-
$xml_obj = @call_user_func_array('simplexml_load_string', $args);
48-
if (!($xml_obj === false)) {
49-
$response = $xml_obj;
47+
$response = @call_user_func_array('simplexml_load_string', $args);
48+
if ($response === false) {
49+
$response = $args['0'];
5050
}
5151
return $response;
5252
}

0 commit comments

Comments
 (0)