From: Derk-Jan Hartman Date: Fri, 19 Nov 2010 01:40:56 +0000 (+0000) Subject: Followup to r76867. Only add canonical if there is no local page for the shared file. X-Git-Tag: 1.31.0-rc.0~33816 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=a3ca8afa9f9d4eb90bf75f415fdbc996784989c3;p=lhc%2Fweb%2Fwiklou.git Followup to r76867. Only add canonical if there is no local page for the shared file. Bug 25960 --- 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 ) ); }