Index: trunk/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -20,11 +20,8 @@ |
21 | 21 | |
22 | 22 | function validateParam( $name, $value ) { |
23 | 23 | if ( in_array( $name, array( 'width', 'height' ) ) ) { |
24 | | - if ( $value <= 0 ) { |
25 | | - return false; |
26 | | - } |
27 | | - return true; |
28 | | - } |
| 24 | + return $value > 0; |
| 25 | + } |
29 | 26 | if ( $name == 'thumbtime' ) { |
30 | 27 | $time = $this->parseTimeString( $value ); |
31 | 28 | if ( $time === false || $time <= 0 ) { |
— | — | @@ -32,10 +29,7 @@ |
33 | 30 | } |
34 | 31 | return true; |
35 | 32 | } |
36 | | - if ( $name == 'noicon' ) { |
37 | | - return true; |
38 | | - } |
39 | | - return false; |
| 33 | + return $name == 'noicon'; |
40 | 34 | } |
41 | 35 | |
42 | 36 | function parseTimeString( $seekString, $length = false ) { |
— | — | @@ -211,9 +205,9 @@ |
212 | 206 | } |
213 | 207 | |
214 | 208 | function doTransform( $file, $dstPath, $dstUrl, $params, $flags = 0 ) { |
215 | | - if ( !$this->normaliseParams( $file, $params ) ) { |
216 | | - return new TransformParameterError( $params ); |
217 | | - } |
| 209 | + if ( !$this->normaliseParams( $file, $params ) ) { |
| 210 | + return new TransformParameterError( $params ); |
| 211 | + } |
218 | 212 | |
219 | 213 | $width = $params['width']; |
220 | 214 | $height = $params['height']; |
— | — | @@ -254,7 +248,6 @@ |
255 | 249 | return new OggVideoDisplay( $file, $targetFileUrl, $dstUrl, $width, $height, $length, $dstPath, $noIcon ); |
256 | 250 | } |
257 | 251 | |
258 | | - |
259 | 252 | $thumbTime = false; |
260 | 253 | if ( isset( $params['thumbtime'] ) ) { |
261 | 254 | $thumbTime = $this->parseTimeString( $params['thumbtime'], $length ); |
— | — | @@ -430,7 +423,7 @@ |
431 | 424 | $wgLang->formatBitrate( $bitrate ), |
432 | 425 | $wgLang->formatNum( $file->getWidth() ), |
433 | 426 | $wgLang->formatNum( $file->getHeight() ) |
434 | | - ); |
| 427 | + ); |
435 | 428 | } |
436 | 429 | |
437 | 430 | function getDimensionsString( $file ) { |