From 241f12f4411c9f78156a14bd58dfbbe146157dcc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 22 Dec 2006 01:02:52 +0000 Subject: [PATCH] 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. --- includes/Parser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.20.1