Followup r74988, brion wins again ;D
authorSam Reed <reedy@users.mediawiki.org>
Tue, 19 Oct 2010 18:40:43 +0000 (18:40 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 19 Oct 2010 18:40:43 +0000 (18:40 +0000)
includes/api/ApiBase.php

index 71e9309..df7ca1b 100644 (file)
@@ -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;
        }