r51411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51410‎ | r51411 | r51412 >
Date:15:36, 3 June 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Followup to r49056: gender property gives "unknown" when gender option is null
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryUsers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUsers.php
@@ -145,8 +145,15 @@
146146 }
147147 if(isset($this->prop['emailable']) && $user->canReceiveEmail())
148148 $data[$name]['emailable'] = '';
149 - if(isset($this->prop['gender']))
150 - $data[$name]['gender'] = $user->getOption( 'gender' );
 149+
 150+ if(isset($this->prop['gender'])) {
 151+ $gender = $user->getOption( 'gender' );
 152+ if ( strval( $gender ) === '' ) {
 153+ $gender = 'unknown';
 154+ }
 155+ $data[$name]['gender'] = $gender;
 156+ }
 157+
151158 if(!is_null($params['token']))
152159 {
153160 $tokenFunctions = $this->getTokenFunctions();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49056Added usprop=gender to list=userssoxred9303:48, 31 March 2009

Status & tagging log