Empty but required-not-empty variables needs now bugfixing
authorRoland Häder <roland@mxchange.org>
Sat, 2 Jul 2011 19:30:00 +0000 (19:30 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 2 Jul 2011 19:30:00 +0000 (19:30 +0000)
inc/extensions-functions.php
inc/functions.php
inc/modules/sponsor.php

index 507e6a10741f9750741fd2b2881b9e531437f5e1..8a47cadc84d048993455694289f372866510af5c 100644 (file)
@@ -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
index 2b9f431af1fe8e86e5855d351e0c40e1859c97fc..d8f842c1f4194d7954f5cddc520fe3e7b1b0f87b 100644 (file)
@@ -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
index eb7297555b39c6495b97b7217ed30b9f3ba8417d..ce813aa415395eb7b354d94d9e7d6f08c33eb9d4 100644 (file)
@@ -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