X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatPhp.php;h=fc25f47723906e8392c171481f67d7156c24d32e;hb=5cbada9dea3f22e7bb33250197b156e8628b8e4a;hp=df9d581f066640d77d8df43564cf0ee39878a18c;hpb=f2244f61f447c3a6556169e3d177e64d2e496a40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index df9d581f06..fc25f47723 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -39,19 +39,19 @@ class ApiFormatPhp extends ApiFormatBase { 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: @@ -65,7 +65,7 @@ class ApiFormatPhp extends ApiFormatBase { // 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. ' . @@ -78,13 +78,13 @@ class ApiFormatPhp extends ApiFormatBase { } public function getAllowedParams() { - $ret = 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; } }