Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git] / includes / api / ApiFormatPhp.php
index f5f2504..fc25f47 100644 (file)
@@ -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 = 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;
        }
 }