]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/yoomedia_functions.php
Fixes for installation phase, old lost call of FILTER_COMPILE_CONFIG() removed
[mailer.git] / inc / libs / yoomedia_functions.php
index 1f67e9ba00dcc591630cd00b5a206c4ecd7fe9fa..75a0362ebc9b8350c9342ea5cd2b754d57bff618 100644 (file)
@@ -169,6 +169,13 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) {
                } // END - if
        } // END - foreach
 
+       // If we have no result, abort here
+       if (count($dummy) == 0) {
+               // Empty response from API
+               logDebugMessage(__FUNCTION__, __LINE__, 'Empy result from API received.');
+               return array();
+       } // END - if
+
        // The result is now still raw, so we must split it up and trim spaces away
        $responseLine = trim(implode("\n", $dummy));
 
@@ -380,11 +387,11 @@ function YOOMEDIA_CONVERT_MODE ($mode) {
        // Convert mode for normal/html
        switch ($mode) {
                case 'normal':
-                       $mode = "textmail";
+                       $mode = 'textmail';
                        break;
 
                case 'html':
-                       $mode = "htmlmail";
+                       $mode = 'htmlmail';
                        break;
        } // END - switch
 
@@ -400,17 +407,17 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) {
        // Which response should we parse?
        if ((isset($response[8])) && (count($response) == 9)) {
                // Use error code from element 8 (mostly API errors)
-               $codeArray = explode("<br>", $response[8]);
+               $codeArray = explode('<br>', $response[8]);
 
                // Use only the first element
                $code = bigintval($codeArray[0]);
        } elseif ((is_array($response[0])) && (isset($response[0]['id']))) {
                // Begin with extraction
-               $codeArray = explode(" ", $response[0]['id']);
+               $codeArray = explode(' ', $response[0]['id']);
                $code = $codeArray[0];
-               $codeArray = explode("<br />", $code);
+               $codeArray = explode('<br />', $code);
                $code = $codeArray[0];
-               $codeArray = explode("<br>", $code);
+               $codeArray = explode('<br>', $code);
                $code = $codeArray[0];
 
                // Remove all new-line characters
@@ -421,7 +428,7 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) {
                $code = str_replace("\n", '', $code);
        } else {
                // Should not happen!
-               logDebugMessage(__FUNCTION__, __LINE__, "Cannot parse response. Raw response=" . base64_encode(serialize($response)));
+               logDebugMessage(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response=' . base64_encode(serialize($response)));
        }
 
        // Return error code