From 86993ed7d3b2dbab9d2725c7782b3e7ab693cd3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 18 Dec 2009 23:58:12 +0000 Subject: [PATCH] Fixes for unset config entries and ['header'] entry --- inc/filters.php | 8 ++++---- inc/wrapper-functions.php | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/inc/filters.php b/inc/filters.php index 627a4007b8..4b16afc996 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -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 diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index f4b8f68b43..e989dd9a79 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -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(); -- 2.30.2