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' ) ) {
}
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;
* @param int $limit
* @param bool $asc
* @return array
+ * @throws MWException
*/
function reallyDoQuery( $offset, $limit, $asc ) {
$prevTableName = $this->mTableName;
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 ) {