From a3ca8afa9f9d4eb90bf75f415fdbc996784989c3 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Fri, 19 Nov 2010 01:40:56 +0000 Subject: [PATCH] Followup to r76867. Only add canonical if there is no local page for the shared file. Bug 25960 --- includes/ImagePage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 04ed3ce203..a1b204fbd6 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -518,7 +518,8 @@ EOT $descUrl = $this->img->getDescriptionUrl(); $descText = $this->img->getDescriptionText(); - if( $descUrl ) { + /* Add canonical to head if there is no local page for this shared file */ + if( $descUrl && $this->getID() == 0 ) { $wgOut->addLink( array( 'rel' => 'canonical', 'href' => $descUrl ) ); } -- 2.20.1