From f993e49ea53408785b52a60db52a713bb72ded24 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 24 Mar 2012 08:19:40 +0100 Subject: [PATCH] * (bug 35449) Removed double call to OutputPage::setRobotPolicy() in SpecialWatchlist::execute() (the other one is hidden in SpecialPage::setHeaders()) * 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 | 1 + includes/specials/SpecialWatchlist.php | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 7ba2c8387f..9255909ebc 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 64a07f14b8..0c5f11cd7c 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -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(); -- 2.20.1