r56995 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56994‎ | r56995 | r56996 >
Date:19:42, 27 September 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* check intval for days and top
* add brackets on if/else
Modified paths:
  • /trunk/extensions/Translate/scripts/languageeditstats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/languageeditstats.php
@@ -32,22 +32,27 @@
3333
3434 /** Process command line parameters
3535 */
36 -if ( isset( $options['help'] ) ) showUsage();
 36+if ( isset( $options['help'] ) ) {
 37+ showUsage();
 38+}
3739
38 -if ( isset( $options['days'] ) )
39 - $hours = $options['days'] * 24; // no day change cutoff
40 -else
 40+if ( isset( $options['days'] ) ) {
 41+ $hours = inval( $options['days'] ) * 24; // no day change cutoff
 42+} else {
4143 $hours = 7 * 24;
 44+}
4245
43 -if ( isset( $options['top'] ) )
44 - $top = $options['top'];
45 -else
 46+if ( isset( $options['top'] ) ) {
 47+ $top = intval( $options['top'] );
 48+} else {
4649 $top = 10;
 50+}
4751
48 -if ( isset( $options['bots'] ) )
 52+if ( isset( $options['bots'] ) ) {
4953 $bots = true;
50 -else
 54+} else {
5155 $bots = false;
 56+}
5257
5358 $namespaces = array();
5459 if ( isset( $options['ns'] ) ) {

Status & tagging log