From: Roland Häder Date: Thu, 29 Oct 2009 03:42:31 +0000 (+0000) Subject: Fixes for parsing success results X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=b8892098435a551703b16c4adf9beb139e29f5b1 Fixes for parsing success results --- diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 6bd9c4e525..c6d55228b8 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -388,18 +388,18 @@ function YOOMEDIA_CONVERT_MODE ($mode) { } // Extract code from response -function YOOMEDIA_GET_ERRORCODE_FROM_RESULT (array $response) { +function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) { // Bad code as default $code = -999; // Which response should we parse? - if (isset($response[8])) { + if ((isset($response[8])) && (count($response) == 9)) { // Use error code from element 8 (mostly API errors) $codeArray = explode("
", $response[8]); // Use only the first element $code = bigintval($codeArray[0]); - } elseif (isset($response[0]['id'])) { + } elseif ((is_array($response[0])) && (isset($response[0]['id']))) { // Begin with extraction $codeArray = explode(" ", $response[0]['id']); $code = $codeArray[0]; diff --git a/inc/request-functions.php b/inc/request-functions.php index 5afd40c3df..a3ff1de26a 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -167,7 +167,7 @@ function postRequestArray () { } // Setter for whole $_POST array -function setPostRequestArray (array $postData) { +function setPostRequestArray ($postData) { $GLOBALS['raw_request']['post'] = $postData; }