* @ingroup Pager
*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Storage\RevisionRecord;
use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\FakeResultWrapper;
*/
private $templateParser;
- public function __construct( IContextSource $context, array $options ) {
+ public function __construct( IContextSource $context, array $options,
+ LinkRenderer $linkRenderer = null
+ ) {
// Set ->target before calling parent::__construct() so
// parent can call $this->getIndexField() and get the right result. Set
// the rest too just to keep things simple.
$this->newOnly = !empty( $options['newOnly'] );
$this->hideMinor = !empty( $options['hideMinor'] );
- parent::__construct( $context );
+ parent::__construct( $context, $linkRenderer );
$msgs = [
'diff',
'options' => [],
'join_conds' => $revQuery['joins'],
];
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
// WARNING: Keep this in sync with getTargetTable()!
$user = User::newFromName( $this->target, false );
$queryInfo['conds'] = array_merge( $queryInfo['conds'], $this->getNamespaceCond() );
// Paranoia: avoid brute force searches (T19342)
- if ( !$user->isAllowed( 'deletedhistory' ) ) {
+ if ( !$permissionManager->userHasRight( $user, 'deletedhistory' ) ) {
$queryInfo['conds'][] = $this->mDb->bitAnd(
'rev_deleted', RevisionRecord::DELETED_USER
) . ' = 0';
- } elseif ( !MediaWikiServices::getInstance()
- ->getPermissionManager()
- ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
- ) {
+ } elseif ( !$permissionManager->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' ) ) {
$queryInfo['conds'][] = $this->mDb->bitAnd(
'rev_deleted', RevisionRecord::SUPPRESSED_USER
) . ' != ' . RevisionRecord::SUPPRESSED_USER;