Merge "Clarify docs for wgCookieExpiration"
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 078e57a..554bfa6 100644 (file)
@@ -989,7 +989,18 @@ class ApiMain extends ApiBase {
        public function getVal( $name, $default = null ) {
                $this->mParamsUsed[$name] = true;
 
-               return $this->getRequest()->getVal( $name, $default );
+               $ret = $this->getRequest()->getVal( $name );
+               if ( $ret === null ) {
+                       if ( $this->getRequest()->getArray( $name ) !== null ) {
+                               // See bug 10262 for why we don't just join( '|', ... ) the
+                               // array.
+                               $this->setWarning(
+                                       "Parameter '$name' uses unsupported PHP array syntax"
+                               );
+                       }
+                       $ret = $default;
+               }
+               return $ret;
        }
 
        /**
@@ -999,9 +1010,7 @@ class ApiMain extends ApiBase {
         * @return bool
         */
        public function getCheck( $name ) {
-               $this->mParamsUsed[$name] = true;
-
-               return $this->getRequest()->getCheck( $name );
+               return $this->getVal( $name, null ) !== null;
        }
 
        /**