r98425 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98424‎ | r98425 | r98426 >
Date:18:20, 29 September 2011
Author:demon
Status:ok
Tags:
Comment:
Swap ParserFuncs to use the timezone funcs (like r60825) rather than putenv() magic.

putenv( 'TZ=foo' ) doesn't work with the 5.4 beta ;-)
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php
@@ -481,14 +481,14 @@
482482 if ( $local ) {
483483 # Use the time zone
484484 if ( isset( $wgLocaltimezone ) ) {
485 - $oldtz = getenv( 'TZ' );
486 - putenv( 'TZ=' . $wgLocaltimezone );
 485+ $oldtz = date_default_timezone_get();
 486+ date_default_timezone_set( $wgLocaltimezone );
487487 }
488488 wfSuppressWarnings(); // E_STRICT system time bitching
489489 $ts = date( 'YmdHis', $unix );
490490 wfRestoreWarnings();
491491 if ( isset( $wgLocaltimezone ) ) {
492 - putenv( 'TZ=' . $oldtz );
 492+ date_default_timezone_set( $oldtz );
493493 }
494494 } else {
495495 $ts = wfTimestamp( TS_MW, $unix );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60825* Fixed the issue of all date functions throwing E_STRICT on their first call...tstarling01:48, 8 January 2010

Status & tagging log