From: Nick Jenkins Date: Thu, 3 May 2007 01:05:51 +0000 (+0000) Subject: Minor tweaks for E_STRICT error_reporting mode warnings: X-Git-Tag: 1.31.0-rc.0~53111 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=84c10464d1e365b709b252047d458ebab662d1ad;p=lhc%2Fweb%2Fwiklou.git Minor tweaks for E_STRICT error_reporting mode warnings: Undefined index: width in includes/media/Generic.php on line 185 Undefined index: width in includes/MediaTransformOutput.php on line 161 Undefined index: height in includes/MediaTransformOutput.php on line 161 on this test: curl --silent --include --globoff -F 'f'='small-email.png' -F 'r'='0' 'http://localhost/wiki/thumb.php' (Using 180 as the fallback width in Generic.php, but if that's not a reasonable default please change). --- diff --git a/includes/MediaTransformOutput.php b/includes/MediaTransformOutput.php index 60057e3ab0..f3e024a690 100644 --- a/includes/MediaTransformOutput.php +++ b/includes/MediaTransformOutput.php @@ -158,7 +158,8 @@ class MediaTransformError extends MediaTransformOutput { class TransformParameterError extends MediaTransformError { function __construct( $params ) { parent::__construct( 'thumbnail_error', - max( @$params['width'], 180 ), max( @$params['height'], 180 ), + max( isset( $params['width'] ) ? $params['width'] : 0, 180 ), + max( isset( $params['height'] ) ? $params['height'] : 0, 180 ), wfMsg( 'thumbnail_invalid_params' ) ); } } diff --git a/includes/media/Generic.php b/includes/media/Generic.php index 5254e0ea3b..a910bc87bc 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -181,8 +181,10 @@ abstract class ImageHandler extends MediaHandler { function makeParamString( $params ) { if ( isset( $params['physicalWidth'] ) ) { $width = $params['physicalWidth']; - } else { + } else if ( isset( $params['width'] ) ) { $width = $params['width']; + } else { + $width = 180; } # Removed for ProofreadPage #$width = intval( $width );