From 4bde8a00c73cd3188258a59ae44a6374a40a3f7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 14 Aug 2009 20:09:29 +0000 Subject: [PATCH 1/1] Handling of unexpected errors from API rewritten --- inc/libs/wernis_functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) == '&') { -- 2.39.2