r107806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107805‎ | r107806 | r107807 >
Date:08:20, 2 January 2012
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
(Half of bug 33454) The week based year number (format char 'o') was being calculated based on server timezone instead of UTC in sprintfDate. [follow-up r45208]

This would cause a couple incorrect results on new years day.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -209,6 +209,8 @@
210210 prevent inheritance to nested tables which caused various issues
211211 * (bug 32686) Tooltip on links to non-existing pages are now always in user's
212212 language
 213+* (bug 33454) ISO-8601 week-based year number (format character 'o') is now
 214+ calculated correctly with respect to timezone
213215
214216 === API changes in 1.19 ===
215217 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/languages/Language.php
@@ -1045,7 +1045,7 @@
10461046 if ( !$unix ) {
10471047 $unix = wfTimestamp( TS_UNIX, $ts );
10481048 }
1049 - $num = date( 'o', $unix );
 1049+ $num = gmdate( 'o', $unix );
10501050 break;
10511051 case 'Y':
10521052 $num = substr( $ts, 0, 4 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r107814Follow-up r107806 - More extensive tests for Language::sprintfDate. Including...bawolff10:41, 2 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45208* handle the "o" format character for PHP 5.1.0+, older versions need emulationdanny_b22:51, 30 December 2008

Comments

#Comment by Nikerabbit (talk | contribs)   08:48, 2 January 2012

This screams for test cases.

#Comment by Bawolff (talk | contribs)   10:42, 2 January 2012

Status & tagging log