Page MenuHomePhabricator

api allusers uses current time for registration if there is a null value in the database
Closed, ResolvedPublic

Description

Author: cbm.wikipedia

Description:
Some users have a null value for their user_registration in the user table.

From enwiki: select user_id, user_name,user_registration from user where user_name='Jclemens';
+---------+-----------+-------------------+

user_iduser_nameuser_registration

+---------+-----------+-------------------+

200029JclemensNULL

+---------+-----------+-------------------+

But the API reports the registration time as the current time when the query is run: the query

http://en.wikipedia.org/w/api.php?action=query&list=allusers&aufrom=Jclemens&auprop=registration

returns: <u name="Jclemens" registration="2009-10-10T15:20:16Z" />

The problem is that the following line in APIQueryAllUsers.php is run regardless whether the user_registration is null, and apparently wfTimestamp defaults to the present time.

$lastUserData['registration'] = wfTimestamp(TS_ISO_8601, $row->user_registration);

Version: unspecified
Severity: minor

Details

Reference
bz21083

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:53 PM
bzimport set Reference to bz21083.

Bryan.TongMinh wrote:

Ideally the backend from users and allusers should be integrated...