From: Roland Häder Date: Fri, 14 Aug 2009 20:14:58 +0000 (+0000) Subject: Wernis API updated to handle unexpected error messages from API X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=42add96d2d56d2e672c8bae56887fc962697768c;p=core.git Wernis API updated to handle unexpected error messages from API --- diff --git a/inc/classes/third_party/api/wernisportal/class_WernisApi.php b/inc/classes/third_party/api/wernisportal/class_WernisApi.php index 9ea8e54b..cb7463b6 100644 --- a/inc/classes/third_party/api/wernisportal/class_WernisApi.php +++ b/inc/classes/third_party/api/wernisportal/class_WernisApi.php @@ -218,7 +218,13 @@ class WernisApi extends BaseFrameworkSystem { } // All (maybe) fine so remove the response header from server - $response = $response[(count($response) - 1)]; + for ($idx = (count($response) - 1); $idx > 1; $idx--) { + $line = trim($response[$idx]); + if (!empty($line)) { + $response = $line; + break; + } + } // Prepare the returning result for higher functions if (substr($response, 0, 1) == '&') {