* @ingroup Pager
*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\FakeResultWrapper;
use Wikimedia\Rdbms\IDatabase;
$queryInfo['conds'][] = $revQuery['fields']['rev_user'] . ' >' . (int)( $max - $max / 100 );
# ignore local groups with the bot right
# @todo FIXME: Global groups may have 'bot' rights
- $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
+ $groupsWithBotPermission = MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->getGroupsWithPermission( 'bot' );
if ( count( $groupsWithBotPermission ) ) {
$queryInfo['tables'][] = 'user_groups';
$queryInfo['conds'][] = 'ug_group IS NULL';
// Paranoia: avoid brute force searches (T19342)
if ( !$user->isAllowed( 'deletedhistory' ) ) {
- $queryInfo['conds'][] = $this->mDb->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0';
- } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
- $queryInfo['conds'][] = $this->mDb->bitAnd( 'rev_deleted', Revision::SUPPRESSED_USER ) .
- ' != ' . Revision::SUPPRESSED_USER;
+ $queryInfo['conds'][] = $this->mDb->bitAnd(
+ 'rev_deleted', RevisionRecord::DELETED_USER
+ ) . ' = 0';
+ } elseif ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
+ ) {
+ $queryInfo['conds'][] = $this->mDb->bitAnd(
+ 'rev_deleted', RevisionRecord::SUPPRESSED_USER
+ ) . ' != ' . RevisionRecord::SUPPRESSED_USER;
}
// $this->getIndexField() must be in the result rows, as reallyDoQuery() tries to access it.
}
$associatedNS = $this->mDb->addQuotes(
- MediaWikiServices::getInstance()->getAssociated( $this->namespace )
+ MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociated( $this->namespace )
);
return [
$classes = [];
$attribs = [];
- $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
+ $linkRenderer = $this->getLinkRenderer();
$page = null;
// Create a title for the revision if possible
&& $page->quickUserCan( 'edit', $user )
) {
$this->preventClickjacking();
- $topmarktext .= ' ' . Linker::generateRollback( $rev, $this->getContext() );
+ $topmarktext .= ' ' . Linker::generateRollback( $rev, $this->getContext(),
+ [ 'noBrackets' ] );
}
}
# Is there a visible previous revision?
- if ( $rev->userCan( Revision::DELETED_TEXT, $user ) && $rev->getParentId() !== 0 ) {
+ if ( $rev->userCan( RevisionRecord::DELETED_TEXT, $user ) && $rev->getParentId() !== 0 ) {
$difftext = $linkRenderer->makeKnownLink(
$page,
new HtmlArmor( $this->messages['diff'] ),
# Note that only unprivileged users have rows with hidden user names excluded.
# When querying for an IP range, we want to always show user and user talk links.
$userlink = '';
- if ( ( $this->contribs == 'newbie' && !$rev->isDeleted( Revision::DELETED_USER ) )
+ if ( ( $this->contribs == 'newbie' && !$rev->isDeleted( RevisionRecord::DELETED_USER ) )
|| $this->isQueryableRange( $this->target ) ) {
$userlink = ' <span class="mw-changeslist-separator"></span> '
. $lang->getDirMark()
];
# Denote if username is redacted for this edit
- if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
+ if ( $rev->isDeleted( RevisionRecord::DELETED_USER ) ) {
$templateParams['rev-deleted-user-contribs'] =
$this->msg( 'rev-deleted-user-contribs' )->escaped();
}