Followup to r76867. Only add canonical if there is no local page for the shared file.
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 19 Nov 2010 01:40:56 +0000 (01:40 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 19 Nov 2010 01:40:56 +0000 (01:40 +0000)
Bug 25960

includes/ImagePage.php

index 04ed3ce..a1b204f 100644 (file)
@@ -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 ) );
                }