Merge "Minor cleanup"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 14 Jan 2013 20:15:14 +0000 (20:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 14 Jan 2013 20:15:14 +0000 (20:15 +0000)
1  2 
includes/api/ApiBase.php

diff --combined includes/api/ApiBase.php
@@@ -340,13 -340,15 +340,15 @@@ abstract class ApiBase extends ContextS
                        return '';
                }
                if ( !is_array( $input ) ) {
-                       $input = array(
-                               $input
-                       );
+                       $input = array( $input );
                }
  
                if ( count( $input ) > 0 ) {
-                       $msg = $title . ( count( $input ) > 1 ? 's' : '' ) . ":\n  ";
+                       if ( $title ) {
+                               $msg = $title . ( count( $input ) > 1 ? 's' : '' ) . ":\n  ";
+                       } else {
+                               $msg = '  ';
+                       }
                        $msg .= implode( $prefix, $input ) . "\n";
                        return $msg;
                }
         * @return string
         */
        function validateTimestamp( $value, $paramName ) {
 -              $value = wfTimestamp( TS_UNIX, $value );
 -              if ( $value === 0 ) {
 +              $unixTimestamp = wfTimestamp( TS_UNIX, $value );
 +              if ( $unixTimestamp === false ) {
                        $this->dieUsage( "Invalid value '$value' for timestamp parameter $paramName", "badtimestamp_{$paramName}" );
                }
 -              return wfTimestamp( TS_MW, $value );
 +              return wfTimestamp( TS_MW, $unixTimestamp );
        }
  
        /**