X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMain.php;h=554bfa67408234a6b7f08412fa742148d79791b4;hb=26fcab1f18c568a41bf4b25d86067434593a87cb;hp=078e57a2940b79c0567ee8c4824be1439deb9499;hpb=f0d1e12ffa186654a2f262c2ac87944feec81eb5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 078e57a294..554bfa6740 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -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; } /**