r105267 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105266‎ | r105267 | r105268 >
Date:01:02, 6 December 2011
Author:krinkle
Status:ok
Tags:
Comment:
[HarvardResearch] Swap ternary operator in registration fallback to zero
* Follows-up :D r105239, r99005, r91244, r84932
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php
@@ -31,7 +31,7 @@
3232
3333 // Returns date of registration in YYYYMMDDHHMMSS format
3434 $result->addValue( $this->getModuleName(),
35 - 'registration', !$user->getRegistration() ? '0' : $user->getRegistration() );
 35+ 'registration', $user->getRegistration() ? $user->getRegistration() : '0' );
3636
3737 // Returns number of edits between daysago date and basetimestamp (or today)
3838 $result->addValue( $this->getModuleName(),
Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -282,7 +282,7 @@
283283
284284 $launchTimestamp = wfTimestamp( TS_UNIX, '2011-12-06 00:00:00' );
285285 $groups = $wgUser->getGroups();
286 - $registrationDate = !$wgUser->getRegistration() ? 0 : $wgUser->getRegistration();
 286+ $registrationDate = $wgUser->getRegistration() ? $wgUser->getRegistration() : 0;
287287 $daysOld = floor( ( $launchTimestamp - wfTimestamp( TS_UNIX, $registrationDate ) ) / ( 60*60*24 ) );
288288 $salt = $wgNoticeBanner_Harvard2011_salt;
289289 $metrics = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r105587MFT r104622, r105267 for UserDailyContribs onlyreedy20:54, 8 December 2011
r105588CentralNotice MFT r105239, 105241, r105267, r105450, r105452, r105453, r105586reedy20:57, 8 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84932handles null registrationnimishg22:15, 28 March 2011
r91244Fix for r84932: explicit checking for null isn't necessary...demon01:55, 1 July 2011
r99005http://en.wikipedia.org/w/api.php?action=userdailycontribs&user=WikiSysop......reedy14:19, 5 October 2011
r105239[HarvardResearch][CentralNotice] Temporary wgNoticeBanner_Harvard2011 data....krinkle22:54, 5 December 2011

Status & tagging log