X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatPhp.php;h=616b341cb83655cde3b78b006210f33e6b6bd650;hb=e0a20177a0068d68315c142a30d56c77c2b3de2f;hp=671f356194c00fc78f7d380bb70b8a3aff1b9baf;hpb=237d3271fd313ebe09858a5c442a91216a7b61cf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index 671f356194..616b341cb8 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -34,6 +30,9 @@ class ApiFormatPhp extends ApiFormatBase { return 'application/vnd.php.serialized'; } + /** + * @suppress SecurityCheck-XSS Output type is not text/html + */ public function execute() { $params = $this->extractRequestParams(); @@ -60,12 +59,12 @@ class ApiFormatPhp extends ApiFormatBase { } $text = serialize( $this->getResult()->getResultData( null, $transforms ) ); - // T68776: wfMangleFlashPolicy() is needed to avoid a nasty bug in + // T68776: OutputHandler::mangleFlashPolicy() avoids a nasty bug in // Flash, but what it does isn't friendly for the API. There's nothing // we can do here that isn't actively broken in some manner, so let's // just be broken in a useful manner. if ( $this->getConfig()->get( 'MangleFlashPolicy' ) && - in_array( 'wfOutputHandler', ob_list_handlers(), true ) && + in_array( 'MediaWiki\\OutputHandler::handle', ob_list_handlers(), true ) && preg_match( '/\<\s*cross-domain-policy(?=\s|\>)/i', $text ) ) { $this->dieWithError( 'apierror-formatphp', 'internalerror' ); @@ -77,8 +76,8 @@ class ApiFormatPhp extends ApiFormatBase { public function getAllowedParams() { $ret = parent::getAllowedParams() + [ 'formatversion' => [ - ApiBase::PARAM_TYPE => [ 1, 2, 'latest' ], - ApiBase::PARAM_DFLT => 1, + ApiBase::PARAM_TYPE => [ '1', '2', 'latest' ], + ApiBase::PARAM_DFLT => '1', ApiBase::PARAM_HELP_MSG => 'apihelp-php-param-formatversion', ], ];