From a053ed73ad376fafb0addceb3033ea737d2e3071 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Thu, 23 Aug 2018 22:47:25 -0700 Subject: [PATCH] Fix #543: Use original response when xml decode fails --- src/Curl/Decoder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Curl/Decoder.php b/src/Curl/Decoder.php index 236cf54..eb50c15 100644 --- a/src/Curl/Decoder.php +++ b/src/Curl/Decoder.php @@ -44,9 +44,9 @@ class Decoder public static function decodeXml() { $args = func_get_args(); - $xml_obj = @call_user_func_array('simplexml_load_string', $args); - if (!($xml_obj === false)) { - $response = $xml_obj; + $response = @call_user_func_array('simplexml_load_string', $args); + if ($response === false) { + $response = $args['0']; } return $response; }