From: Derk-Jan Hartman Date: Wed, 17 Nov 2010 00:23:30 +0000 (+0000) Subject: When displaying non-local File pages, add link rel=canonical. X-Git-Tag: 1.31.0-rc.0~33844 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=23d0b968d8e07166899ea4ab304d1e7038500484;p=lhc%2Fweb%2Fwiklou.git When displaying non-local File pages, add link rel=canonical. Solves bug 25960 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5d4f669af4..315ca0948d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -204,6 +204,8 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 22463) Add hook 'SkinGetPoweredBy' to make 'powered by' icon/text customizable * Added CSS print pagination to the print stylesheets +* (bug 25960) Add for File pages of shared/foreign + file repositories. === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/ImagePage.php b/includes/ImagePage.php index c12d5ddb0f..04ed3ce203 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -518,6 +518,10 @@ EOT $descUrl = $this->img->getDescriptionUrl(); $descText = $this->img->getDescriptionText(); + if( $descUrl ) { + $wgOut->addLink( array( 'rel' => 'canonical', 'href' => $descUrl ) ); + } + $wrap = "
\n$1\n
\n"; $repo = $this->img->getRepo()->getDisplayName();