From: Sam Reed Date: Thu, 5 Aug 2010 06:08:23 +0000 (+0000) Subject: Move if ( is_array( $value ) && !$dupes ) { up to else block after the first !is_arra... X-Git-Tag: 1.31.0-rc.0~35713 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=0345d5e08f007758017282f84d556c95818a36c9;p=lhc%2Fweb%2Fwiklou.git Move if ( is_array( $value ) && !$dupes ) { up to else block after the first !is_array. If it's not not an array, it's an array, and therefore, we can just filter dupes if requested --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index c53fd2f166..8e799fb13c 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -736,10 +736,8 @@ abstract class ApiBase { default: ApiBase::dieDebug( __METHOD__, "Param $encParamName's type is unknown - $type" ); } - } - - // Throw out duplicates if requested - if ( is_array( $value ) && !$dupes ) { + } else if ( !$dupes ) { + // Throw out duplicates if requested $value = array_unique( $value ); }