* (bug 26597) Allow toggling of persistent cookies ("remember me") in API
action=login
* (bug 29237) add interwiki target url attribute to api/query/interwiki
+* (bug 28392) mark action=undelete×tamps as type "timestamp"
=== Languages updated in 1.19 ===
}
break;
case 'timestamp':
- if ( $multi ) {
- ApiBase::dieDebug( __METHOD__, "Multi-values not supported for $encParamName" );
- }
- $value = wfTimestamp( TS_UNIX, $value );
- if ( $value === 0 ) {
- $this->dieUsage( "Invalid value '$value' for timestamp parameter $encParamName", "badtimestamp_{$encParamName}" );
+ if ( is_array( $value ) ) {
+ foreach ( $value as $key => $val ) {
+ $value[$key] = $this->validateTimestamp( $val, $encParamName );
+ }
+ } else {
+ $value = $this->validateTimestamp( $value, $encParamName );
}
- $value = wfTimestamp( TS_MW, $value );
break;
case 'user':
if ( !is_array( $value ) ) {
}
}
+ /**
+ * @param $value string
+ * @param $paramName string
+ * @return string
+ */
+ function validateTimestamp( $value, $paramName ) {
+ $value = wfTimestamp( TS_UNIX, $value );
+ if ( $value === 0 ) {
+ $this->dieUsage( "Invalid value '$value' for timestamp parameter $paramName", "badtimestamp_{$paramName}" );
+ }
+ return wfTimestamp( TS_MW, $value );
+ }
+
/**
* Adds a warning to the output, else dies
*
'token' => null,
'reason' => '',
'timestamps' => array(
- ApiBase::PARAM_ISMULTI => true
+ ApiBase::PARAM_TYPE => 'timestamp',
+ ApiBase::PARAM_ISMULTI => true,
),
'watchlist' => array(
ApiBase::PARAM_DFLT => 'preferences',