From 866f478dc93eb70d2b381ecf3a9614ae66105a97 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Fri, 25 Apr 2014 17:50:18 -0700 Subject: [PATCH] Append redirect=no to RecentChanges/Watchlist redirect entries This change adds redirect=no in the URL of redirect entries in the RecentChanges or in the Watchlist. Entries which are not redirects will not be affected. Some typos in documentation were also fixed. Bug: 890 Change-Id: I79593811d92b2f57abd742c8ba9e66769d8bc9b7 --- RELEASE-NOTES-1.24 | 2 ++ includes/Feed.php | 4 ++-- includes/changes/ChangesList.php | 3 +++ includes/specials/SpecialRecentchanges.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 48ea3d425d..42eadaa82f 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -18,6 +18,8 @@ production. option and a size specification set will now always ignore the provided size and display an unscaled image, as the documentation has always claimed it would. +* (bug 890) Links in Special:RecentChanges and Special:Watchlist no longer + follow redirects to their target pages. === Web API changes in 1.24 === diff --git a/includes/Feed.php b/includes/Feed.php index 1b995195cb..7089c925bd 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -93,7 +93,7 @@ class FeedItem { } /** - * set the unique id of an item + * Set the unique id of an item * * @param string $uniqueId Unique id for the item * @param bool $rssIsPermalink Set to true if the guid (unique id) is a permalink (RSS feeds only) @@ -141,7 +141,7 @@ class FeedItem { } /** - * Get the title of this item + * Get the date of this item * * @return string */ diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 69e1e9ea5d..246f95d211 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -344,6 +344,9 @@ class ChangesList extends ContextSource { */ public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) { $params = array(); + if ( $rc->getTitle()->isRedirect() ) { + $params = array( 'redirect' => 'no' ); + } $articlelink = Linker::linkKnown( $rc->getTitle(), diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index f1a31a5925..f770307801 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -527,7 +527,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { } /** - * Create a input to filter changes by categories + * Create an input to filter changes by categories * * @param FormOptions $opts * @return array -- 2.20.1