$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
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();