X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialListfiles.php;h=2d79aaf8e89e31fe8018e22a0939cebf951aa2e8;hb=d964c0ed629bcc9620e2a6e2d9b02741d3eaba25;hp=760704d90e183d3d68c38370a650e23d81355469;hpb=a300fabb68430e6204eebceb2af9ddbffd72017a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 760704d90e..2d79aaf8e8 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( + "
\n$1\n
", + 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; @@ -425,7 +437,7 @@ class ImageListPager extends TablePager { function formatValue( $field, $value ) { switch ( $field ) { case 'thumb': - $opt = array( 'time' => $this->mCurrentRow->img_timestamp ); + $opt = array( 'time' => wfTimestamp( TS_MW, $this->mCurrentRow->img_timestamp ) ); $file = RepoGroup::singleton()->getLocalRepo()->findFile( $value, $opt ); // If statement for paranoia if ( $file ) {