Merge "Add plural to message 'rcnotefrom'"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 9c28d06..b1fbdea 100644 (file)
@@ -83,14 +83,20 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         * 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
+        * @param int $limit Maximum number of results to return
         * @return string[] Matching subpages
         */
        public function prefixSearchSubpages( $search, $limit = 10 ) {
                // See also SpecialEditWatchlist::prefixSearchSubpages
-               $subpages = array( 'clear', 'edit', 'raw' );
-               $escaped = preg_quote( $search );
-               return array_slice( preg_grep( "/^$escaped/i", $subpages ), 0, $limit );
+               return self::prefixSearchArray(
+                       $search,
+                       $limit,
+                       array(
+                               'clear',
+                               'edit',
+                               'raw',
+                       )
+               );
        }
 
        /**
@@ -252,7 +258,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                // the necessary rights.
                if ( !$user->isAllowed( 'deletedhistory' ) ) {
                        $bitmask = LogPage::DELETED_ACTION;
-               } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+               } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
                        $bitmask = LogPage::DELETED_ACTION | LogPage::DELETED_RESTRICTED;
                } else {
                        $bitmask = 0;
@@ -382,12 +388,12 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        }
 
        /**
-        * Return the text to be displayed above the changes
+        * Set the text to be displayed above the changes
         *
         * @param FormOptions $opts
-        * @return string XHTML
+        * @param int $numRows Number of rows in the result to show after this header
         */
-       public function doHeader( $opts ) {
+       public function doHeader( $opts, $numRows ) {
                $user = $this->getUser();
 
                $this->getOutput()->addSubtitle(