From: Jens Frank Date: Tue, 7 Dec 2004 21:19:02 +0000 (+0000) Subject: (bug 1024) Fix link to high-res image version on Image: pages X-Git-Tag: 1.5.0alpha1~1131 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d74a8995d98f3b8f1c1163c7278053123e281738;p=lhc%2Fweb%2Fwiklou.git (bug 1024) Fix link to high-res image version on Image: pages --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 6b52070614..3609c0073b 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -43,7 +43,7 @@ class ImagePage extends Article { global $wgOut, $wgUser, $wgImageLimits, $wgRequest, $wgUseImageResize, $wgRepositoryBaseUrl; $this->img = Image::newFromTitle( $this->mTitle ); - $url = $this->img->getViewURL(); + $full_url = $this->img->getViewURL(); $anchoropen = ''; $anchorclose = ''; if ( $wgUseImageResize ) { @@ -71,26 +71,25 @@ class ImagePage extends Article { $height = $this->img->getHeight(); $msg = wfMsg('showbigimage', $width, $height, intval( $this->img->getSize()/1024 ) ); if ( $width > $maxWidth && $wgUseImageResize ) { - $anchoropen = ""; - $anchorclose = "
{$msg}
"; - - $url = $this->img->createThumb( $maxWidth ); $height = floor( $height * $maxWidth / $width ); $width = $maxWidth; } if ( $height > $maxHeight && $wgUseImageResize ) { - $anchoropen = ""; - $anchorclose = "
{$msg}
"; - $width = floor( $width * $maxHeight / $height ); $height = $maxHeight; + } + if ( $width != $this->img->getWidth() || $height != $this->img->getHeight() ) { $url = $this->img->createThumb( $width ); + $anchoropen = ""; + $anchorclose = "
{$msg}
"; + } else { + $url = $full_url; } - $s = "
" . $anchoropen . + $s = '"; + htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '
'; } else { - $s = "
".$sk->makeMediaLink($this->img->getName(),"")."
"; + $s = "
" . $sk->makeMediaLink( $this->img->getName(),'' ) . '
'; } $wgOut->addHTML( $s ); if($this->img->fromSharedDirectory) {