follow up r62353 Make ApiBase::requireOnlyOneParameter() accept parameters that are...
authorMark A. Hershberger <mah@users.mediawiki.org>
Mon, 15 Feb 2010 07:06:49 +0000 (07:06 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Mon, 15 Feb 2010 07:06:49 +0000 (07:06 +0000)
includes/api/ApiBase.php

index a6a7a0a..ff54af1 100644 (file)
@@ -474,7 +474,7 @@ abstract class ApiBase {
        }
 
        /**
-        * Die if none or more than one of a certain set of parameters is set
+        * Die if none or more than one of a certain set of parameters is set and not false.
         * @param $params array of parameter names
         */
        public function requireOnlyOneParameter( $params ) {
@@ -482,7 +482,7 @@ abstract class ApiBase {
                array_shift( $required );
 
                $intersection = array_intersect( array_keys( array_filter( $params,
-                               create_function( '$x', 'return !is_null($x);' )
+                               create_function( '$x', 'return !is_null($x) && $x !== false;' )
                        ) ), $required );
                if ( count( $intersection ) > 1 ) {
                        $this->dieUsage( 'The parameters ' . implode( ', ', $intersection ) . ' can not be used together', 'invalidparammix' );