Hack a special case for regression in setting image height via box size (eg 200x200px).
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 25 Aug 2007 15:49:36 +0000 (15:49 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 25 Aug 2007 15:49:36 +0000 (15:49 +0000)
The height had been simply dropped off the face of the earth, with only the width taken into account anymore.
The infrastructure for parameters doesn't seem to gracefully handle multiple values coming from one magic word match, so this is an ugly hack.

includes/Parser.php

index da8d512..af358cd 100644 (file)
@@ -4569,6 +4569,17 @@ class Parser
                        if ( isset( $paramMap[$magicName] ) ) {
                                list( $type, $paramName ) = $paramMap[$magicName];
                                $params[$type][$paramName] = $value;
+                               
+                               // Special case; width and height come in one variable together
+                               if( $type == 'handler' && $paramName == 'width' ) {
+                                       $m = array();
+                                       if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $value, $m ) ) {
+                                               $params[$type]['width'] = intval( $m[1] );
+                                               $params[$type]['height'] = intval( $m[2] );
+                                       } else {
+                                               $params[$type]['width'] = intval( $value );
+                                       }
+                               }
                        } else {
                                $caption = $part;
                        }