Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / includes / api / ApiFormatPhp.php
index fc25f47..671f356 100644 (file)
@@ -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 );