*Use wfSuppressWarnings() instead of error_reporting()
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 20 Jun 2007 22:25:39 +0000 (22:25 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 20 Jun 2007 22:25:39 +0000 (22:25 +0000)
includes/OutputPage.php
includes/Parser.php
languages/Language.php

index d072451..75e4ef9 100644 (file)
@@ -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 );
index bc73b57..4f4fdf0 100644 (file)
@@ -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':
index 0352f73..e635baf 100644 (file)
@@ -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;
        }