X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiFormatPhp.php;h=671f356194c00fc78f7d380bb70b8a3aff1b9baf;hb=49748181dd56ec97e7ba7c13e684a16abceb3cc0;hp=fc25f47723906e8392c171481f67d7156c24d32e;hpb=c0e47a90c41a7e5eeb5ce9e513ee2f63fb836dba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index fc25f47723..671f356194 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -55,11 +55,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 +68,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 );