X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiFormatPhp.php;h=a744f57becf1d07a99429b529355fe456fd33935;hp=d111af5d33f1d1c027ae5a0adb938fe959999c07;hb=ce079cf6ad79ca8d3360817f809b219d166f9153;hpb=fc1ca75323b5f424a9f8d28d42d85a311ed2f721 diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index d111af5d33..a744f57bec 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -55,7 +55,8 @@ class ApiFormatPhp extends ApiFormatBase { break; default: - $this->dieUsage( __METHOD__ . ': Unknown value for \'formatversion\'', 'unknownformatversion' ); + // Should have been caught during parameter validation + $this->dieDebug( __METHOD__, 'Unknown value for \'formatversion\'' ); } $text = serialize( $this->getResult()->getResultData( null, $transforms ) ); @@ -65,13 +66,9 @@ 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. ' . - 'See https://phabricator.wikimedia.org/T68776', - 'internalerror' - ); + $this->dieWithError( 'apierror-formatphp', 'internalerror' ); } $this->printText( $text );