The API takes multi-valued parameters as key=value1|value2|value3, not
key[]=value1&key[]=value2&key[]=value3, in part because the latter is
overly verbose when the API encourages use of large arrays.
But when someone, not knowing this, does accidentally use the verbose
syntax, they should get a warning instead of having the parameter be
silently ignored.
Bug: 64057
Change-Id: I32a16efb8028d7f6d120d20dfc886f08ed9ec97d
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;
}
/**
* was used, for logging.
*/
public function getCheck( $name ) {
- $this->mParamsUsed[$name] = true;
-
- return $this->getRequest()->getCheck( $name );
+ return $this->getVal( $name, null ) !== null;
}
/**