Page MenuHomePhabricator

Recent changes RSS feed broken in Windows
Closed, DeclinedPublic

Description

Author: rupert

Description:
This is on PHP version 5.0.5 (apache2handler) & MySQL: 5.0.20-nt
The recent changes RSS feed is terminated prematurely with the following PHP
warnings:

RSS feed Warning: gmmktime() [function.gmmktime]: Windows does not support
negative values for this function in
C:\Fat32\wwwroot\mediawiki-1.6.3\includes\GlobalFunctions.php on line 1255

Warning: gmdate() [function.gmdate]: Windows does not support dates prior to
midnight (00:00:00), January 1, 1970 in
C:\Fat32\wwwroot\mediawiki-1.6.3\includes\GlobalFunctions.php on line 1286

I have traced this to line 410 of BagOStuff.php, which needs to be changed from:

return $dbw->timestamp('9999-12-31 12:59:59');

to:

return $dbw->timestamp('2037-12-31 12:59:59');

I think this is the fault of PHP rather than Windows, but I just thought it
might be helpful to others to have it fixed. Hope this is OK. (My first bugfix!)


Version: 1.6.x
Severity: normal
OS: Windows XP
Platform: PC

Details

Reference
bz5661

Event Timeline

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

rupert wrote:

I think this is the fault of PHP rather than Windows, but I just thought it
might be helpful to others to have it fixed. Hope this is OK. (My first bugfix!)

I meant to say, "I think this is the fault of PHP on Windows, rather than MediaWiki"

Upgrade to PHP 5.1.0:

Quoting: http://www.php.net/manual/en/function.mktime.php

Before PHP 5.1.0, negative timestamps were not supported under any known version
of Windows and some other systems as well. Therefore the range of valid years
was limited to 1970 through 2038.

rupert wrote:

Yes, I'm well aware that it works on that version, but why resist the fix for an
older version, particularly after I have already taken the trouble to do it, so
nobody else has to.