From: Brion Vibber Date: Fri, 22 Dec 2006 01:02:52 +0000 (+0000) Subject: Tweak fix for bug 8335 to avoid breaking dubious, but used, variants. X-Git-Tag: 1.31.0-rc.0~54820 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=241f12f4411c9f78156a14bd58dfbbe146157dcc;p=lhc%2Fweb%2Fwiklou.git Tweak fix for bug 8335 to avoid breaking dubious, but used, variants. If we were able to get an integer out of it, let it pass. --- diff --git a/includes/Parser.php b/includes/Parser.php index 545651242e..484c7dc891 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4413,11 +4413,11 @@ class Parser wfDebug( "img_width match: $match\n" ); # $match is the image width in pixels $m = array(); - if ( is_numeric($match) ) { - $width = intval($match); - } elseif ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) { + if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) { $width = intval( $m[1] ); $height = intval( $m[2] ); + } else { + $width = intval($match); } } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) { $framed=true;