From: Roland Häder Date: Fri, 14 Aug 2009 20:09:29 +0000 (+0000) Subject: Handling of unexpected errors from API rewritten X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4bde8a00c73cd3188258a59ae44a6374a40a3f7a;p=mailer.git Handling of unexpected errors from API rewritten --- diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 56302d59e6..b9418aa9d5 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -113,7 +113,13 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { } // END - if // All (maybe) fine so remove the response header from server - $response = $response[(count($response) - 1)]; + for ($idx = (count($response) - 1); $idx > 1; $idx--) { + $line = $response[$idx]; + if (!empty($line)) { + $response = $line; + break; + } + } // Prepare the returning result for higher functions if (substr($response, 0, 1) == '&') {