X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiFormatPhp.php;h=b05097afe3b00a4c99af17d2500c7752660d7195;hp=fc25f47723906e8392c171481f67d7156c24d32e;hb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;hpb=1dd2e07276e1deaf431ddb01c92111038f9e2cd6 diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index fc25f47723..b05097afe3 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 @@ -55,11 +51,12 @@ 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 ) ); - // Bug 66776: wfMangleFlashPolicy() is needed to avoid a nasty bug in + // T68776: wfMangleFlashPolicy() is needed to avoid 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. @@ -67,11 +64,7 @@ class ApiFormatPhp extends ApiFormatBase { in_array( 'wfOutputHandler', ob_list_handlers(), true ) && 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 );