* $wgUploadNavigationUrl now also affects images inline images that do not
exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
it as appropriate.
-
+* If $wgLocaltimezone is null, use the server's timezone as the default for
+ signatures. This was always the behaviour documented in DefaultSettings.php
+ but has not been the actual behaviour for some time: instead, UTC was used
+ by default.
+
+
=== New features in 1.16 ===
* Add CSS defintion of the 'wikitable' class to shared.css
type selector on Special:Log
* (bug 20115) Special:Userlogin title says "Log in / create account" even if the
user can't create an account
+* (bug 2658) Don't attempt to set the TZ environment variable.
== API changes in 1.16 ==
/**
* Fake out the timezone that the server thinks it's in. This will be used for
* date display and not for what's stored in the DB. Leave to null to retain
- * your server's OS-based timezone value. This is the same as the timezone.
+ * your server's OS-based timezone value.
*
- * This variable is currently used ONLY for signature formatting, not for
- * anything else.
+ * This variable is currently used only for signature formatting and for local
+ * time/date parser variables ({{LOCALTIME}} etc.)
*
* Timezones can be translated by editing MediaWiki messages of type
* timezone-nameinlowercase like timezone-utc.
* $wgLocalTZoffset = date("Z") / 60;
*
* If your server is not configured for the timezone you want, you can set
- * this in conjunction with the signature timezone and override the TZ
- * environment variable like so:
+ * this in conjunction with the signature timezone and override the PHP default
+ * timezone like so:
* $wgLocaltimezone="Europe/Berlin";
- * putenv("TZ=$wgLocaltimezone");
+ * date_default_timezone_set( $wgLocaltimezone );
* $wgLocalTZoffset = date("Z") / 60;
*
* Leave at NULL to show times in universal time (UTC/GMT).
);
}
-
if ( !class_exists( 'AutoLoader' ) ) {
require_once( "$IP/includes/AutoLoader.php" );
}
require_once( "$IP/includes/StubObject.php" );
wfProfileOut( $fname.'-includes' );
wfProfileIn( $fname.'-misc1' );
+
# Raise the memory limit if it's too low
wfMemoryLimit();
+/**
+ * Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+
+ * that happens whenever you use a date function without the timezone being
+ * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
+ */
+wfSuppressWarnings();
+date_default_timezone_set( date_default_timezone_get() );
+wfRestoreWarnings();
+
$wgIP = false; # Load on demand
# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
$wgRequest = new WebRequest;
# Use the time zone
global $wgLocaltimezone;
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
$localTimestamp = date( 'YmdHis', $ts );
$localMonth = date( 'm', $ts );
$localMonth1 = date( 'n', $ts );
$localYear = date( 'Y', $ts );
$localHour = date( 'H', $ts );
if ( isset( $wgLocaltimezone ) ) {
- putenv( 'TZ='.$oldtz );
+ date_default_timezone_set( $oldtz );
}
- wfRestoreWarnings();
switch ( $index ) {
case 'currentmonth':
* (see also bug 12815)
*/
$ts = $this->mOptions->getTimestamp();
- $tz = wfMsgForContent( 'timezone-utc' );
if ( isset( $wgLocaltimezone ) ) {
- $unixts = wfTimestamp( TS_UNIX, $ts );
- $oldtz = getenv( 'TZ' );
- putenv( 'TZ='.$wgLocaltimezone );
- $ts = date( 'YmdHis', $unixts );
- $tz = date( 'T', $unixts ); # might vary on DST changeover!
+ $tz = $wgLocaltimezone;
+ } else {
+ $tz = date_default_timezone_get();
+ }
- /* Allow translation of timezones trough wiki. date() can return
- * whatever crap the system uses, localised or not, so we cannot
- * ship premade translations.
- */
- $key = 'timezone-' . strtolower( trim( $tz ) );
- $value = wfMsgForContent( $key );
- if ( !wfEmptyMsg( $key, $value ) ) $tz = $value;
+ $unixts = wfTimestamp( TS_UNIX, $ts );
+ $oldtz = date_default_timezone_get();
+ date_default_timezone_set( $tz );
+ $ts = date( 'YmdHis', $unixts );
+ $tzMsg = date( 'T', $unixts ); # might vary on DST changeover!
- putenv( 'TZ='.$oldtz );
- }
+ /* Allow translation of timezones trough wiki. date() can return
+ * whatever crap the system uses, localised or not, so we cannot
+ * ship premade translations.
+ */
+ $key = 'timezone-' . strtolower( trim( $tzMsg ) );
+ $value = wfMsgForContent( $key );
+ if ( !wfEmptyMsg( $key, $value ) ) $tzMsg = $value;
+
+ date_default_timezone_set( $oldtz );
- $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tz)";
+ $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)";
# Variable replacement
# Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags