r79213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79212‎ | r79213 | r79214 >
Date:22:28, 29 December 2010
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
Followup r71751: change strict comparison to loose per CR, and add a comment explaining why
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1948,7 +1948,7 @@
19491949 $da = array();
19501950 $strtime = '';
19511951
1952 - if ( $ts === 0 ) {
 1952+ if ( $ts == 0 ) { // This intentionally catches $ts === '' too, so DON'T change this to ===
19531953 $uts = time();
19541954 $strtime = "@$uts";
19551955 } elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D', $ts, $da ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r79214Fix r79213: and $ts === null too, per CRcatrope22:30, 29 December 2010
r793731.17: MFT r78308, r78622, r79089, r79185, r79199, r79213, r79214, r79253catrope21:09, 31 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71751Merge r71750 to trunk: let wfTimestamp() accept TS_RFC2822 as an input format...catrope21:02, 26 August 2010

Comments

#Comment by Platonides (talk | contribs)   22:29, 29 December 2010

And $ts = null, too.

#Comment by Platonides (talk | contribs)   15:47, 30 December 2010

It was too easy. It breaks now parsing of RFC 2822 and RFC 822 dates. Good thing we had tests for them.

PHP fun of having ('Mon, 15 Jan 2001 12:34:56 GMT' == 0) === true.

Replace the condition with an empty() ?

#Comment by Platonides (talk | contribs)   16:12, 30 December 2010

Fixed in r79253

Status & tagging log