X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Flibs%2Fyoomedia_functions.php;h=ab92eba1d2f2ff54cb2e28f4e38e02e311fb677b;hb=797955d491179ef77612e476a2079ed5563f1a93;hp=a0e9c5a70fffe1b4d5f16bfd82e840b0d05b60d2;hpb=b964523185fff36755ab2bc1e6fbabe4ffd554f8;p=mailer.git diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index a0e9c5a70f..ab92eba1d2 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -18,6 +18,7 @@ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -118,7 +119,7 @@ function YOOMEDIA_TEST_CONFIG ($data) { $errorCode = YOOMEDIA_GET_ERRORCODE_FROM_RESULT($response); // Log the response if failed - if (count($response) == '0') { + if (count($response) == 0) { // Queries depleted (as we count here!) logDebugMessage(__FUNCTION__, __LINE__, 'Requested depleted. Maxmimum was: ' . getConfig('yoomedia_requests_total')); $errorCode = -1; @@ -334,7 +335,7 @@ function translateYooMediaError ($errorCode) { $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode]; } else { // Log missing entries - debug_report_bug(sprintf("Unknown error code %s detected.", $errorCode)); + debug_report_bug(sprintf("Unknown error code %s[%s] detected.", $errorCode, gettype($errorCode))); } // Return value @@ -359,7 +360,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) { if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) { // Remove entry SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_yoomedia_reload` WHERE `id`=%s LIMIT 1", - array($id), __FUNCTION__, __LINE__); + array($id), __FUNCTION__, __LINE__); } else { // Dont' sent again this mail $reloaded = $time; @@ -430,11 +431,17 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) { // Remove carrige-return $code = str_replace("\n", '', $code); + } else { // Should not happen! - logDebugMessage(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response=' . base64_encode(serialize($response))); + debug_report_bug('Cannot parse response. Raw response:
' . print_r($response, true) . '
'); } + // Fix empty code to bad + if (empty($code)) { + $code = -999; + } // END - if + // Return error code return $code; }