wfTimestamp returns false on failure.
Renamed variable to output original input on failure and not the false
Change-Id: I39d31f35dae88b8a6e50ebee76a3be8722603ef3
* @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 );
}
/**