* (bug 35449) Removed double call to OutputPage::setRobotPolicy() in SpecialWatchlist...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 24 Mar 2012 07:19:40 +0000 (08:19 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 24 Mar 2012 07:19:40 +0000 (08:19 +0100)
* Special:Watchlist no longer sets links to feed when the user is anonymous

I did not add a RELEASE-NOTES entry for such trivial change, but rather for the second one which is more problematic that I found while investigating the bug.

Change-Id: I5ca6ccc1339ceacd98371e660d26876b6283decd

RELEASE-NOTES-1.19
includes/specials/SpecialWatchlist.php

index 7ba2c83..9255909 100644 (file)
@@ -33,6 +33,7 @@ production.
   inside a heading.
 * (bug 34907) Fixed exposure of tokens through load.php that could have facilitated
   CSRF attacks
+* Special:Watchlist no longer sets links to feed when the user is anonymous
 
 === Configuration changes in 1.19 ===
 * Removed SkinTemplateSetupPageCss hook; use BeforePageDisplay instead.
index 64a07f1..0c5f11c 100644 (file)
@@ -40,22 +40,10 @@ class SpecialWatchlist extends SpecialPage {
                $user = $this->getUser();
                $output = $this->getOutput();
 
-               // Add feed links
-               $wlToken = $user->getOption( 'watchlisttoken' );
-               if ( !$wlToken ) {
-                       $wlToken = MWCryptRand::generateHex( 40 );
-                       $user->setOption( 'watchlisttoken', $wlToken );
-                       $user->saveSettings();
-               }
-
-               $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
-                                                       'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
-
-               $output->setRobotPolicy( 'noindex,nofollow' );
-
                # Anons don't get a watchlist
                if( $user->isAnon() ) {
                        $output->setPageTitle( $this->msg( 'watchnologin' ) );
+                       $output->setRobotPolicy( 'noindex,nofollow' );
                        $llink = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
                                $this->msg( 'loginreqlink' )->escaped(),
@@ -66,6 +54,17 @@ class SpecialWatchlist extends SpecialPage {
                        return;
                }
 
+               // Add feed links
+               $wlToken = $user->getOption( 'watchlisttoken' );
+               if ( !$wlToken ) {
+                       $wlToken = MWCryptRand::generateHex( 40 );
+                       $user->setOption( 'watchlisttoken', $wlToken );
+                       $user->saveSettings();
+               }
+
+               $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
+                                                       'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
+
                $this->setHeaders();
                $this->outputHeader();