switch ( $params['formatversion'] ) {
case 1:
- $transforms = array(
- 'BC' => array(),
- 'Types' => array(),
+ $transforms = [
+ 'BC' => [],
+ 'Types' => [],
'Strip' => 'all',
- );
+ ];
break;
case 2:
case 'latest':
- $transforms = array(
- 'Types' => array(),
+ $transforms = [
+ 'Types' => [],
'Strip' => 'all',
- );
+ ];
break;
default:
// just be broken in a useful manner.
if ( $this->getConfig()->get( 'MangleFlashPolicy' ) &&
in_array( 'wfOutputHandler', ob_list_handlers(), true ) &&
- preg_match( '/\<\s*cross-domain-policy\s*\>/i', $text )
+ preg_match( '/\<\s*cross-domain-policy(?=\s|\>)/i', $text )
) {
$this->dieUsage(
'This response cannot be represented using format=php. ' .
}
public function getAllowedParams() {
- $ret = parent::getAllowedParams() + array(
- 'formatversion' => array(
- ApiBase::PARAM_TYPE => array( 1, 2, 'latest' ),
+ $ret = parent::getAllowedParams() + [
+ 'formatversion' => [
+ ApiBase::PARAM_TYPE => [ 1, 2, 'latest' ],
ApiBase::PARAM_DFLT => 1,
ApiBase::PARAM_HELP_MSG => 'apihelp-php-param-formatversion',
- ),
- );
+ ],
+ ];
return $ret;
}
}