From: Sam Reed Date: Tue, 19 Oct 2010 18:40:43 +0000 (+0000) Subject: Followup r74988, brion wins again ;D X-Git-Tag: 1.31.0-rc.0~34421 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=056b6463080ce6669b28a8bbf7bdcb6ebb3168dc;p=lhc%2Fweb%2Fwiklou.git Followup r74988, brion wins again ;D --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 71e93090a6..df7ca1beeb 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -532,7 +532,7 @@ abstract class ApiBase { array_shift( $required ); $intersection = array_intersect( array_keys( array_filter( $params, - "validateParameter" ) ), $required ); + array( $this, "parameterNotEmpty" ) ) ), $required ); if ( count( $intersection ) > 1 ) { $this->dieUsage( 'The parameters ' . implode( ', ', $intersection ) . ' can not be used together', 'invalidparammix' ); @@ -541,7 +541,13 @@ abstract class ApiBase { } } - private function validateParameter( $x ) { + /** + * Callback function used in requireOnlyOneParameter to check whether reequired parameters are set + * + * @param $x object Parameter to check is not null/false + * @return bool + */ + private function parameterNotEmpty( $x ) { return !is_null( $x ) && $x !== false; }