From d36548e2c5b2440d041b895ec5b24bf33bcbe8e3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 20 Jun 2007 22:25:39 +0000 Subject: [PATCH] *Use wfSuppressWarnings() instead of error_reporting() --- includes/OutputPage.php | 4 ++-- includes/Parser.php | 5 ++--- languages/Language.php | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index d0724515ec..75e4ef932d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -158,9 +158,9 @@ class OutputPage { # this breaks strtotime(). $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] ); - $oe_level = error_reporting(E_ALL); //grrrr + wfSuppressWarnings(); // E_STRICT system time bitching $modsinceTime = strtotime( $modsince ); - error_reporting($oe_level); //grrrr + wfRestoreWarnings(); $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 ); wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false ); diff --git a/includes/Parser.php b/includes/Parser.php index bc73b572e7..4f4fdf091d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2416,8 +2416,8 @@ class Parser $oldtz = getenv( 'TZ' ); putenv( 'TZ='.$wgLocaltimezone ); } - $oe_level = error_reporting(E_ALL); #grrrr + wfSuppressWarnings(); // E_STRICT system time bitching $localTimestamp = date( 'YmdHis', $ts ); $localMonth = date( 'm', $ts ); $localMonthName = date( 'n', $ts ); @@ -2430,8 +2430,7 @@ class Parser if ( isset( $wgLocaltimezone ) ) { putenv( 'TZ='.$oldtz ); } - - error_reporting($oe_level); #grrrr + wfRestoreWarnings(); switch ( $index ) { case 'currentmonth': diff --git a/languages/Language.php b/languages/Language.php index 0352f73103..e635baf70c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -438,7 +438,7 @@ class Language { # No difference ? Return time unchanged if ( 0 == $hrDiff && 0 == $minDiff ) { return $ts; } - $eo_level = error_reporting(E_ALL); //grrr, no system date bitching + wfSuppressWarnings(); // E_STRICT system time bitching # Generate an adjusted date $t = mktime( ( (int)substr( $ts, 8, 2) ) + $hrDiff, # Hours @@ -449,7 +449,7 @@ class Language { (int)substr( $ts, 0, 4 ) ); #Year $date = date( 'YmdHis', $t ); - error_reporting($eo_level); //grrr + wfRestoreWarnings(); return $date; } -- 2.20.1