mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-11-15 11:59:54 +00:00
Swap ParserFuncs to use the timezone funcs (like r60825) rather than putenv() magic.
putenv( 'TZ=foo' ) doesn't work with the 5.4 beta ;-)
This commit is contained in:
parent
e764705f57
commit
e188af9e04
|
@ -481,14 +481,14 @@ class ExtParserFunctions {
|
|||
if ( $local ) {
|
||||
# Use the time zone
|
||||
if ( isset( $wgLocaltimezone ) ) {
|
||||
$oldtz = getenv( 'TZ' );
|
||||
putenv( 'TZ=' . $wgLocaltimezone );
|
||||
$oldtz = date_default_timezone_get();
|
||||
date_default_timezone_set( $wgLocaltimezone );
|
||||
}
|
||||
wfSuppressWarnings(); // E_STRICT system time bitching
|
||||
$ts = date( 'YmdHis', $unix );
|
||||
wfRestoreWarnings();
|
||||
if ( isset( $wgLocaltimezone ) ) {
|
||||
putenv( 'TZ=' . $oldtz );
|
||||
date_default_timezone_set( $oldtz );
|
||||
}
|
||||
} else {
|
||||
$ts = wfTimestamp( TS_MW, $unix );
|
||||
|
|
Loading…
Reference in a new issue