From 756b356e431ffdd0e243d662d884244b0dcb7bd5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 25 Aug 2007 15:49:36 +0000 Subject: [PATCH] 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. --- includes/Parser.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } -- 2.20.1