From: Brion Vibber Date: Sat, 25 Aug 2007 15:49:36 +0000 (+0000) Subject: Hack a special case for regression in setting image height via box size (eg 200x200px). X-Git-Tag: 1.31.0-rc.0~51666 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=756b356e431ffdd0e243d662d884244b0dcb7bd5;p=lhc%2Fweb%2Fwiklou.git Hack a special case for regression in setting image height via box size (eg 200x200px). 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. --- diff --git a/includes/Parser.php b/includes/Parser.php index da8d512f0f..af358cd9e1 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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; }