From 42add96d2d56d2e672c8bae56887fc962697768c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 14 Aug 2009 20:14:58 +0000 Subject: [PATCH] Wernis API updated to handle unexpected error messages from API --- .../third_party/api/wernisportal/class_WernisApi.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) == '&') { -- 2.39.5