diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 968af1e544adc..6c856e98afd6f 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -52,6 +52,8 @@ public function execute( $par ) { if ( $this->including() ) { $out->addParserOutputContent( $pager->getBodyOutput() ); } else { + $user = $pager->getRelevantUser(); + $this->getSkin()->setRelevantUser( $user ); $pager->getForm(); $out->addParserOutputContent( $pager->getFullOutput() ); } @@ -91,6 +93,13 @@ class ImageListPager extends TablePager { protected $mUserName = null; + /** + * The relevant user + * + * @var User|null + */ + protected $mUser = null; + protected $mSearch = ''; protected $mIncluding = false; @@ -108,20 +117,18 @@ function __construct( IContextSource $context, $userName = null, $search = '', if ( $userName !== null && $userName !== '' ) { $nt = Title::newFromText( $userName, NS_USER ); - $user = User::newFromName( $userName, false ); - if ( !is_null( $nt ) ) { + if ( is_null( $nt ) ) { + $this->outputUserDoesNotExist( $userName ); + } else { $this->mUserName = $nt->getText(); + $user = User::newFromName( $this->mUserName, false ); + if ( $user ) { + $this->mUser = $user; + } + if ( !$user || ( $user->isAnon() && !User::isIP( $user->getName() ) ) ) { + $this->outputUserDoesNotExist( $userName ); + } } - if ( !$user || ( $user->isAnon() && !User::isIP( $user->getName() ) ) ) { - $this->getOutput()->wrapWikiMsg( - "