SECURITY: Avoid deleted usernames leak in page_recent_contributors

Bug: T71367
Change-Id: I8d5ed9ca84282ee50832035af86123633fc88293
This commit is contained in:
Daimona Eaytoy 2021-03-09 15:53:36 -06:00 committed by sbassett
parent 5c355d3acb
commit f25c96f472

View file

@ -262,6 +262,7 @@ class LazyVariableComputer {
case 'load-first-author':
$revision = $this->revisionLookup->getFirstRevision( $parameters['title'] );
if ( $revision ) {
// TODO T233241
$user = $revision->getUser();
$result = $user === null ? '' : $user->getName();
} else {
@ -409,7 +410,12 @@ class LazyVariableComputer {
$revAuthors = $dbr->selectFieldValues(
$revQuery['tables'],
$revQuery['fields']['rev_user_text'],
[ 'rev_page' => $title->getArticleID() ],
[
'rev_page' => $title->getArticleID(),
// TODO Should deleted names be counted in the 10 authors? If yes, this check should
// be moved inside the foreach
'rev_deleted' => 0
],
$fname,
// Some pages have < 10 authors but many revisions (e.g. bot pages)
[ 'ORDER BY' => 'rev_timestamp DESC, rev_id DESC',