From: quix0r Date: Sat, 2 Jul 2011 19:30:00 +0000 (+0000) Subject: Empty but required-not-empty variables needs now bugfixing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cdfeaa243772ff20edfad5dc2f6501f903a59982;p=mailer.git Empty but required-not-empty variables needs now bugfixing --- diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 507e6a1074..8a47cadc84 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -744,11 +744,11 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) { } // Output verbose SQL table for extension -function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false, $width = '100%') { +function addExtensionVerboseSqlTable ($title = '{--ADMIN_SQLS_EXECUTED_ON_REMOVAL--}', $dashed = '', $switch = false, $width = '100%') { // Empty title? if (empty($title)) { - // Then fix it to default - $title = '{--ADMIN_SQLS_EXECUTED_ON_REMOVAL--}'; + // Then abort here + debug_report_bug(__FUNCTION__, __LINE__, 'title is empty.'); } // END - if // Init variables diff --git a/inc/functions.php b/inc/functions.php index 2b9f431af1..d8f842c1f4 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -85,11 +85,16 @@ function getTotalFatalErrors () { // Send mail out to an email address function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '') { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'toEmail=' . $toEmail . ',subject=' . $subject . ',isHtml=' . $isHtml); + // Empty parameters should be avoided, so we need to find them + if (empty($isHtml)) { + // isHtml is empty + debug_report_bug(__FUNCTION__, __LINE__, 'isHtml is empty.'); + } // END - if // Set from header if ((!isInStringIgnoreCase('@', $toEmail)) && ($toEmail > 0)) { // Does the user exist? - if (fetchUserData($toEmail)) { + if ((isExtensionActive('user')) && (fetchUserData($toEmail))) { // Get the email $toEmail = getUserData('email'); } else { @@ -123,11 +128,6 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' } } // END - if - // Fix HTML parameter (default is no!) - if (empty($isHtml)) { - $isHtml = 'N'; - } // END - if - // Debug mode enabled? if (isDebugModeEnabled()) { // In debug mode we want to display the mail instead of sending it away so we can debug this part diff --git a/inc/modules/sponsor.php b/inc/modules/sponsor.php index eb7297555b..ce813aa415 100644 --- a/inc/modules/sponsor.php +++ b/inc/modules/sponsor.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { return; } elseif ((!isWhatSet()) || (getWhat() == '')) { // Empty what value detected! - setWhat('welcome'); + debug_report_bug(__FUNCTION__, __LINE__, 'what is empty.'); } // A valid sponsor login and we are allowed to enter this module so let's