Fixes for unset config entries and ['header'] entry
authorRoland Häder <roland@mxchange.org>
Fri, 18 Dec 2009 23:58:12 +0000 (23:58 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 18 Dec 2009 23:58:12 +0000 (23:58 +0000)
inc/filters.php
inc/wrapper-functions.php

index 627a4007b89bc12e39c14db67edfe2de6421aae4..4b16afc996283990a5da94df0b5039fe9b172e6a 100644 (file)
@@ -534,24 +534,24 @@ function FILTER_RUN_RESET_INCLUDES () {
                $currWeek = date('W', time());
 
                // Has it changed?
-               if ((getConfig('last_week') != $currWeek) || (getConfig('DEBUG_WEEKLY') == 'Y')) {
+               if ((getConfig('last_week') != $currWeek) || ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'))) {
                        // Include weekly reset scripts
                        mergeIncludePool('reset', getArrayFromDirectory('inc/weekly/', 'weekly_'));
 
                        // Update config
-                       if ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') != 'Y')) updateConfiguration('last_week', $currWeek);
+                       if ((!isConfigEntrySet('DEBUG_WEEKLY')) || (getConfig('DEBUG_WEEKLY') != 'Y')) updateConfiguration('last_week', $currWeek);
                } // END - if
 
                // Create current month mark
                $currMonth = date('m', time());
 
                // Has it changed?
-               if ((getConfig('last_month') != $currMonth) || (getConfig('DEBUG_MONTHLY') == 'Y')) {
+               if ((getConfig('last_month') != $currMonth) || ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'))) {
                        // Include monthly reset scripts
                        mergeIncludePool('reset', getArrayFromDirectory('inc/monthly/', 'monthly_'));
 
                        // Update config
-                       if ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') != 'Y')) updateConfiguration('last_month', $currMonth);
+                       if ((!isConfigEntrySet('DEBUG_MONTHLY')) || (getConfig('DEBUG_MONTHLY') != 'Y')) updateConfiguration('last_month', $currMonth);
                } // END - if
        } // END - if
 
index f4b8f68b43b79f79f81ede0d7881bfc1e57d4bf8..e989dd9a79aa392fe0d4847acf4dc69debbc1831 100644 (file)
@@ -407,10 +407,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();