Tweak fix for bug 8335 to avoid breaking dubious, but used, variants.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 22 Dec 2006 01:02:52 +0000 (01:02 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 22 Dec 2006 01:02:52 +0000 (01:02 +0000)
If we were able to get an integer out of it, let it pass.

includes/Parser.php

index 5456512..484c7dc 100644 (file)
@@ -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;