(bug 30269) Strings like foobar//barfoo are linked to become foobar[//barfoo]
[lhc/web/wiklou.git] / includes / ImageGallery.php
index cc561b4..4d5f067 100644 (file)
@@ -58,6 +58,8 @@ class ImageGallery {
 
        /**
         * Register a parser object
+        *
+        * @param $parser Parser
         */
        function setParser( $parser ) {
                $this->mParser = $parser;
@@ -219,7 +221,7 @@ class ImageGallery {
 
                if ( $this->mPerRow > 0 ) {
                        $maxwidth = $this->mPerRow * ( $this->mWidths + self::THUMB_PADDING + self::GB_PADDING + self::GB_BORDERS );
-                       $oldStyle = isset( $this->mAttribs['style'] ) ? $this->mAttribs['style'] : ''; 
+                       $oldStyle = isset( $this->mAttribs['style'] ) ? $this->mAttribs['style'] : '';
                        # _width is ignored by any sane browser. IE6 doesn't know max-width so it uses _width instead
                        $this->mAttribs['style'] = "max-width: {$maxwidth}px;_width: {$maxwidth}px;" . $oldStyle;
                }
@@ -279,10 +281,7 @@ class ImageGallery {
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $img->getLastError() ) . '</div>';
                        } else {
-                               # We get layout problems with the margin, if the image is smaller 
-                               # than the line-height (17), so we add less margin in these cases.
-                               $minThumbHeight =  $thumb->height > 17 ? $thumb->height : 17;
-                               $vpad = floor( ( self::THUMB_PADDING + $this->mHeights - $minThumbHeight ) /2 );
+                               $vpad = ( self::THUMB_PADDING + $this->mHeights - $thumb->height ) /2;
 
                                $imageParameters = array(
                                        'desc-link' => true,