Fix bounding box feature of thumbnails (e.g. |200x200px|)
authorJens Frank <jeluf@users.mediawiki.org>
Mon, 11 Oct 2004 19:02:56 +0000 (19:02 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Mon, 11 Oct 2004 19:02:56 +0000 (19:02 +0000)
includes/MagicWord.php
includes/Skin.php

index 4651ba8..a8fd0eb 100644 (file)
@@ -193,10 +193,10 @@ class MagicWord {
                $matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches );
                if ( $matchcount == 0 ) {
                        return NULL;
-               } elseif ( count($matches) == 1 ) {
+               } elseif ( count($matches) == 2 ) {
                        return $matches[0];
                } else {
-                       return $matches[1];
+                       return $matches[2];
                }
        }
 
index 6e4f447..c3cae13 100644 (file)
@@ -1767,8 +1767,6 @@ class Skin {
 
                                if (    ( ! $height === false )
                                     && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) {
-                                       print "height=$height<br>\nimg->getHeight() = ".$img->getHeight()."<br>\n";
-                                       print 'rescaling by factor '. $height / $img->getHeight() . "<br>\n";
                                        $width = $img->getWidth() * $height / $img->getHeight();
                                }
                                if ( '' == $manual_thumb ) $url = $img->createThumb( $width );