r25136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25135‎ | r25136 | r25137 >
Date:15:49, 25 August 2007
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -4569,6 +4569,17 @@
45704570 if ( isset( $paramMap[$magicName] ) ) {
45714571 list( $type, $paramName ) = $paramMap[$magicName];
45724572 $params[$type][$paramName] = $value;
 4573+
 4574+ // Special case; width and height come in one variable together
 4575+ if( $type == 'handler' && $paramName == 'width' ) {
 4576+ $m = array();
 4577+ if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $value, $m ) ) {
 4578+ $params[$type]['width'] = intval( $m[1] );
 4579+ $params[$type]['height'] = intval( $m[2] );
 4580+ } else {
 4581+ $params[$type]['width'] = intval( $value );
 4582+ }
 4583+ }
45734584 } else {
45744585 $caption = $part;
45754586 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r25223Merged revisions 25126-25214 via svnmerge from...david07:39, 28 August 2007

Status & tagging log