From: X! Date: Wed, 24 Feb 2010 17:04:21 +0000 (+0000) Subject: PARAM_TYPE 'user' now works for multi-values X-Git-Tag: 1.31.0-rc.0~37618 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=fe72f84205549aa8e77c3d3dd9332c606ec9fd6e;p=lhc%2Fweb%2Fwiklou.git PARAM_TYPE 'user' now works for multi-values --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 25b5690fef..3905995a68 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -645,11 +645,18 @@ abstract class ApiBase { $value = wfTimestamp( TS_MW, $value ); break; case 'user': - $title = Title::makeTitleSafe( NS_USER, $value ); - if ( is_null( $title ) ) { - $this->dieUsage( "Invalid value for user parameter $encParamName", "baduser_{$encParamName}" ); + if( !is_array( $value ) ) $value = array( $value ); + + foreach( $value as $val ) { + $title = Title::makeTitleSafe( NS_USER, $value ); + if ( is_null( $title ) ) { + $this->dieUsage( "Invalid value for user parameter $encParamName", "baduser_{$encParamName}" ); + } + $value = $title->getText(); } - $value = $title->getText(); + + if( !$multi ) $value = $value[0]; + break; default: ApiBase::dieDebug( __METHOD__, "Param $encParamName's type is unknown - $type" );