Merge "Set Language in SpecialSearchTest.php"
[lhc/web/wiklou.git] / includes / specials / SpecialListfiles.php
index 7576c1f..8de4e2f 100644 (file)
@@ -52,7 +52,7 @@ class SpecialListFiles extends IncludableSpecialPage {
                if ( $this->including() ) {
                        $out->addParserOutputContent( $pager->getBodyOutput() );
                } else {
-                       $out->addHTML( $pager->getForm() );
+                       $pager->getForm();
                        $out->addParserOutputContent( $pager->getFullOutput() );
                }
        }
@@ -90,14 +90,25 @@ class ImageListPager extends TablePager {
 
                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' ) ) {
                        $this->mSearch = $search;
-                       $nt = Title::newFromURL( $this->mSearch );
+                       $nt = Title::newFromText( $this->mSearch );
 
                        if ( $nt ) {
                                $dbr = wfGetDB( DB_SLAVE );
@@ -136,7 +147,7 @@ class ImageListPager extends TablePager {
                }
 
                if ( $this->mSearch !== '' ) {
-                       $nt = Title::newFromURL( $this->mSearch );
+                       $nt = Title::newFromText( $this->mSearch );
                        if ( $nt ) {
                                $dbr = wfGetDB( DB_SLAVE );
                                $conds[] = 'LOWER(' . $prefix . '_name)' .