r23145 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23144‎ | r23145 | r23146 >
Date:22:25, 20 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Use wfSuppressWarnings() instead of error_reporting()
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2416,8 +2416,8 @@
24172417 $oldtz = getenv( 'TZ' );
24182418 putenv( 'TZ='.$wgLocaltimezone );
24192419 }
2420 - $oe_level = error_reporting(E_ALL); #grrrr
24212420
 2421+ wfSuppressWarnings(); // E_STRICT system time bitching
24222422 $localTimestamp = date( 'YmdHis', $ts );
24232423 $localMonth = date( 'm', $ts );
24242424 $localMonthName = date( 'n', $ts );
@@ -2430,8 +2430,7 @@
24312431 if ( isset( $wgLocaltimezone ) ) {
24322432 putenv( 'TZ='.$oldtz );
24332433 }
2434 -
2435 - error_reporting($oe_level); #grrrr
 2434+ wfRestoreWarnings();
24362435
24372436 switch ( $index ) {
24382437 case 'currentmonth':
Index: trunk/phase3/includes/OutputPage.php
@@ -158,9 +158,9 @@
159159 # this breaks strtotime().
160160 $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
161161
162 - $oe_level = error_reporting(E_ALL); //grrrr
 162+ wfSuppressWarnings(); // E_STRICT system time bitching
163163 $modsinceTime = strtotime( $modsince );
164 - error_reporting($oe_level); //grrrr
 164+ wfRestoreWarnings();
165165
166166 $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
167167 wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
Index: trunk/phase3/languages/Language.php
@@ -438,7 +438,7 @@
439439 # No difference ? Return time unchanged
440440 if ( 0 == $hrDiff && 0 == $minDiff ) { return $ts; }
441441
442 - $eo_level = error_reporting(E_ALL); //grrr, no system date bitching
 442+ wfSuppressWarnings(); // E_STRICT system time bitching
443443 # Generate an adjusted date
444444 $t = mktime( (
445445 (int)substr( $ts, 8, 2) ) + $hrDiff, # Hours
@@ -449,7 +449,7 @@
450450 (int)substr( $ts, 0, 4 ) ); #Year
451451
452452 $date = date( 'YmdHis', $t );
453 - error_reporting($eo_level); //grrr
 453+ wfRestoreWarnings();
454454
455455 return $date;
456456 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r23203Merged revisions 23120-23202 via svnmerge from...david09:07, 22 June 2007

Status & tagging log