Merge "User#getOption: Check ignoreHidden before $wgHiddenPrefs"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 6a35aa0..d263202 100644 (file)
@@ -393,7 +393,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                $fields = RecentChange::selectFields();
                // JOIN on watchlist for users
-               if ( $uid ) {
+               if ( $uid && $this->getUser()->isAllowed( 'viewmywatchlist' ) ) {
                        $tables[] = 'watchlist';
                        $fields[] = 'wl_user';
                        $fields[] = 'wl_notificationtimestamp';
@@ -516,6 +516,13 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $counter = 1;
                $list = ChangesList::newFromContext( $this->getContext() );
 
+               if ( $rows->numRows() === 0 ) {
+                       $this->getOutput()->wrapWikiMsg(
+                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+                       );
+                       return;
+               }
+
                $s = $list->beginRecentChangesList();
                foreach ( $rows as $obj ) {
                        if ( $limit == 0 ) {
@@ -707,8 +714,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        }
 
        /**
-        * Send the text to be displayed after the options, for use in
-        * Recentchangeslinked
+        * Send the text to be displayed after the options, for use in subclasses.
         *
         * @param FormOptions $opts
         */