Reverted of changes in 1704, see ticket #160
[mailer.git] / inc / wrapper-functions.php
index f4b8f68b43b79f79f81ede0d7881bfc1e57d4bf8..9de0106688795fd32e271459b3955db2ff1afe76 100644 (file)
@@ -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 *
@@ -340,6 +341,11 @@ function isDebugModeEnabled () {
        return ((isConfigEntrySet('DEBUG_MODE')) && (getConfig('DEBUG_MODE') == 'Y'));
 }
 
+// Checks wether SQL debugging is enabled
+function isSqlDebuggingEnabled () {
+       return ((isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y'));
+}
+
 // Checks wether we shall debug regular expressions
 function isDebugRegExpressionEnabled () {
        // Simply check it
@@ -407,10 +413,12 @@ function flushHeaders () {
                debug_report_bug('Headers already sent!');
        } // END - if
 
-       // Flush all headers
-       foreach ($GLOBALS['header'] as $header) {
-               header($header);
-       } // END - foreach
+       // Flush all headers if found
+       if ((isset($GLOBALS['header'])) && (is_array($GLOBALS['header']))) {
+               foreach ($GLOBALS['header'] as $header) {
+                       header($header);
+               } // END - foreach
+       } // END - if
 
        // Mark them as flushed
        $GLOBALS['header'] = array();