From 0345d5e08f007758017282f84d556c95818a36c9 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 5 Aug 2010 06:08:23 +0000 Subject: [PATCH] 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 --- includes/api/ApiBase.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 ); } -- 2.20.1