Page MenuHomePhabricator

Preferences screen fails on unspecified timezone
Open, LowPublic


Author: ed

It would appear that the PHP date_create() function fails (freezes) when the timezone isn't specified. To fix this problem, I modified Includes/Specials/SpecialPreferences.php, around line 1052, as follows:


$now = date_create( 'now );

After ($wgLocaltimezone is specified in LocalSettings.php):

global $wgLocaltimezone;
$now = date_create( 'now', $wgLocaltimezone );

This happened on my system, running Windows Server 2003, MediaWiki 1.15.4, PHP 5.3.0 (apache2handler), MySQL 5.1.35-community.

Version: 1.15.x
Severity: major
OS: Windows Server 2003
Platform: PC



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:03 PM
bzimport set Reference to bz24308.
bzimport added a subscriber: Unknown Object (MLST).

ed wrote:

... the "Before" is really this: $now = date_create( 'now' );

Reedy added a comment.Jul 9 2010, 6:30 AM

Code is at 1197 of includes/Preferences.php now (in trunk), and also in 1.16

"If $timezone is omitted, the current timezone will be used."

Seems to work fine on my trunk install.. PHP windows bug?

ed wrote:

That is what I would suspect, which is why I made it quite clear exactly what my configuration was. It works ok on Windows XP and Linux Ubuntu, but not on Windows Server 2003. I guess I should have mentioned where it DID work too...

Anyway, it seems to work now, with my patch, in Windows Server 2003. Thanks for putting the fix in the main version.

ed wrote:

I put the fix in 1.16.0beta3, Preferences.php, around line 1193, and it fixes the problem. I was testing with Windows Server 2003, PHP 5.3.0 (apache2handler), MySQL 5.1.35-community.

sumanah wrote:

Ed, can you test with an installation of MediaWiki 1.17.0 and see whether the issue still happens (that is, without your patch)? And if the issue still happens, and your patch fixes it, could you attach it *as a patch*?