diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index e58f7ea5698..d3c785bc320 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -201,7 +201,8 @@ class ApiQueryImageInfo extends ApiQueryBase { if ( isset( $prop['user'] ) ) { $vals['user'] = $file->getUser(); - } else if ( isset( $prop['userid'] ) ) { + } + if ( isset( $prop['userid'] ) ) { $vals['userid'] = $file->getUser( 'id' ); } if ( !$file->getUser( 'id' ) ) { diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 77c41b9d2bc..610dd0b0bdc 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -372,7 +372,8 @@ class ApiQueryRevisions extends ApiQueryBase { } else { if ( $this->fld_user ) { $vals['user'] = $revision->getUserText(); - } else { + } + if ( $this->fld_userid ) { $user = User::newFromText( $revision->getUserText() ); $vals['userid'] = $user->getId(); }