From 94ef54ceaf87a6ed60e05b3c2021a55de855ac5f Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 13 Feb 2009 16:17:39 +0000 Subject: [PATCH] Add a tag on redirected page views per --- RELEASE-NOTES | 1 + includes/Article.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5ce56ed5de..d3ab9e6a1f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -97,6 +97,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add NUMBEROFACTIVEUSERS magic word, which is like NUMBEROFUSERS, but uses the active users data from site_stats. * (bug 13040) Gender-aware user namespace aliases +* Add a tag on redirected page views === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/Article.php b/includes/Article.php index 28928fe29f..82e33889c5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -836,6 +836,11 @@ class Article { $fragment = Xml::escapeJsString( $this->mTitle->getFragmentForURL() ); $wgOut->addInlineScript( "redirectToFragment(\"$fragment\");" ); } + + // Add a tag + $wgOut->addLink( array( 'rel' => 'canonical', + 'href' => $this->mTitle->getFullURL() ) + ); $wasRedirected = true; } } elseif( !empty( $rdfrom ) ) { -- 2.20.1