summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialListfiles.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/specials/SpecialListfiles.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/specials/SpecialListfiles.php')
-rw-r--r--includes/specials/SpecialListfiles.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php
index d4b45fb3..2d79aaf8 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -84,14 +84,26 @@ class ImageListPager extends TablePager {
function __construct( IContextSource $context, $userName = null, $search = '',
$including = false, $showAll = false
) {
+ $this->setContext( $context );
$this->mIncluding = $including;
$this->mShowAll = $showAll;
if ( $userName !== null && $userName !== '' ) {
$nt = Title::newFromText( $userName, NS_USER );
+ $user = User::newFromName( $userName, false );
if ( !is_null( $nt ) ) {
$this->mUserName = $nt->getText();
}
+ if ( !$user || ( $user->isAnon() && !User::isIP( $user->getName() ) ) ) {
+ $this->getOutput()->wrapWikiMsg(
+ "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
+ array(
+ 'listfiles-userdoesnotexist',
+ wfEscapeWikiText( $userName ),
+ )
+ );
+ }
+
}
if ( $search !== '' && !$this->getConfig()->get( 'MiserMode' ) ) {
@@ -107,7 +119,7 @@ class ImageListPager extends TablePager {
}
if ( !$including ) {
- if ( $context->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) {
+ if ( $this->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) {
$this->mDefaultDirection = IndexPager::DIR_DESCENDING;
} else {
$this->mDefaultDirection = IndexPager::DIR_ASCENDING;