From 40a3f53ad48b0205d39498ab28d526b4fd30a0ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 4 Mar 2010 05:41:50 +0000 Subject: [PATCH] Some fixes for bug-mails --- inc/extensions/ext-yoomedia.php | 17 +++++++++-------- inc/language/yoomedia_de.php | 1 + inc/libs/yoomedia_functions.php | 10 ++++++++-- inc/wrapper-functions.php | 23 ++++++++++++++++++++++- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 8d1803bec1..f6b350c0fa 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -124,14 +124,15 @@ UNIQUE `y_type` (`type`,`y_id`) $GLOBALS['translation_tables']['yoomedia'] = array( // Error messages 'error_codes' => array( - 1 => 'wrong_pass', - 2 => 'wrong_sid', - 3 => 'website_locked', - 4 => 'api_data_error', - 5 => 'requests_depleted', - 6 => 'zero_result', - 7 => 'no_campaigns_with_interface', - 10 => 'incomplete_request' + -999 => 'unknown_error', + 1 => 'wrong_pass', + 2 => 'wrong_sid', + 3 => 'website_locked', + 4 => 'api_data_error', + 5 => 'requests_depleted', + 6 => 'zero_result', + 7 => 'no_campaigns_with_interface', + 10 => 'incomplete_request' ), // For text mails 'textmail' => array( diff --git a/inc/language/yoomedia_de.php b/inc/language/yoomedia_de.php index f6fc876bfd..91667672d8 100644 --- a/inc/language/yoomedia_de.php +++ b/inc/language/yoomedia_de.php @@ -87,6 +87,7 @@ addMessages(array( 'ADMIN_YOOMEDIA_TM_ACTIONS' => "Aktionen", // Error messages for admin + 'ADMIN_YOOMEDIA_ERROR_UNKNOWN' => "Unbekannter/leerer Fehler von API erhalten. Möglicherweise keine API-Daten angegeben.", 'ADMIN_YOOMEDIA_ERROR_FAILED' => "Allgemeiner Fehler von API, nicht weiter spezifiziert.", 'ADMIN_YOOMEDIA_ERROR_TITLE' => "Fehler bei Abfrage der Yoo!Media API 2.0", 'ADMIN_YOOMEDIA_ERROR_WRONG_PASS' => "Falsches Interfacepasswort angegeben.", diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index a91329b4e9..ef00bd8e29 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -335,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 @@ -360,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; @@ -431,11 +431,17 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) { // Remove carrige-return $code = str_replace("\n", '', $code); + } else { // Should not happen! 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; } diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 43b1b306c4..c56adab059 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -741,7 +741,28 @@ function getPhpCaching () { // Checks wether the admin hash is set function isAdminHashSet ($admin) { - if (!isset($GLOBALS['cache_array']['admin'])) debug_report_bug('Cache not set.'); + /** + * @TODO Do we really need this check? If yes, try to fix this: + * 1.:functions.php:2504, debug_get_mailable_backtrace(0) + * 2.:wrapper-functions.php:744, debug_report_bug(1) + * 3.:mysql-manager.php:728, isAdminHashSet(1) + * 4.:filters.php:384, isAdmin(0) + * 5.:debug_get_mailable_backtrace:2457, FILTER_DETERMINE_USERNAME(1) + * 6.:filter-functions.php:280, call_user_func_array(2) + * 7.:load_cache.php:74, runFilterChain(1) + * 8.:inc-functions.php:131, include(1) + * 9.:inc-functions.php:145, loadInclude(1) + * 10.:mysql-connect.php:104, loadIncludeOnce(1) + * 11.:inc-functions.php:131, include(1) + * 12.:inc-functions.php:145, loadInclude(1) + * 13.:config-global.php:106, loadIncludeOnce(1) + * 14.:js.php:57, require(1) + */ + if (!isset($GLOBALS['cache_array']['admin'])) { + debug_report_bug('Cache not set.'); + } // END - if + + // Check for admin hash return isset($GLOBALS['cache_array']['admin']['password'][$admin]); } -- 2.39.2