summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialListfiles.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
commit6dc1997577fab2c366781fd7048144935afa0012 (patch)
tree8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/specials/SpecialListfiles.php
parent150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff)
parentfa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff)
Merge commit 'fa89acd'
# Conflicts: # .gitignore # extensions/ArchInterWiki.sql
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;