X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatPhp.php;h=616b341cb83655cde3b78b006210f33e6b6bd650;hb=55c9d4deee52e886eb71df97169372fd047ef4bc;hp=b05097afe3b00a4c99af17d2500c7752660d7195;hpb=f673cfd18a0fa8eb1c9ef0a34e2c1eb9c124a5e9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index b05097afe3..616b341cb8 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -30,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(); @@ -56,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' ); @@ -73,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', ], ];