Merge "Workaround image magick issue with greyscale xcf files"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 490e81f..21a1f9b 100644 (file)
@@ -79,6 +79,26 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                parent::execute( $subpage );
        }
 
+       /**
+        * Return an array of subpages beginning with $search that this special page will accept.
+        *
+        * @param string $search Prefix to search for
+        * @param integer $limit Maximum number of results to return
+        * @return string[] Matching subpages
+        */
+       public function prefixSearchSubpages( $search, $limit = 10 ) {
+               // See also SpecialEditWatchlist::prefixSearchSubpages
+               return self::prefixSearchArray(
+                       $search,
+                       $limit,
+                       array(
+                               'clear',
+                               'edit',
+                               'raw',
+                       )
+               );
+       }
+
        /**
         * Get a FormOptions object containing the default options
         *
@@ -317,6 +337,14 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                        $output->showLagWarning( $lag );
                }
 
+               # If no rows to display, show message before try to render the list
+               if ( $rows->numRows() == 0 ) {
+                       $output->wrapWikiMsg(
+                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+                       );
+                       return;
+               }
+
                $dbr->dataSeek( $rows, 0 );
 
                $list = ChangesList::newFromContext( $this->getContext() );
@@ -356,13 +384,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                }
                $s .= $list->endRecentChangesList();
 
-               if ( $rows->numRows() == 0 ) {
-                       $output->wrapWikiMsg(
-                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
-                       );
-               } else {
-                       $output->addHTML( $s );
-               }
+               $output->addHTML( $s );
        }
 
        /**