Merge "Try to fix some other broken-looking legacy maintenance script options"
[lhc/web/wiklou.git] / includes / specials / SpecialUploadStash.php
index f2da81f..199eebd 100644 (file)
@@ -306,6 +306,8 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                if ( $size > self::MAX_SERVE_BYTES ) {
                        throw new SpecialUploadStashTooLargeException();
                }
+               // Cancel output buffering and gzipping if set
+               wfResetOutputBuffers();
                self::outputFileHeaders( $contentType, $size );
                print $content;
 
@@ -367,13 +369,14 @@ class SpecialUploadStash extends UnlistedSpecialPage {
 
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( $this->getPageTitle() ); // Remove subpage
-               $form = new HTMLForm( [
+               $form = HTMLForm::factory( 'ooui', [
                        'Clear' => [
                                'type' => 'hidden',
                                'default' => true,
                                'name' => 'clear',
                        ]
                ], $context, 'clearStashedUploads' );
+               $form->setSubmitDestructive();
                $form->setSubmitCallback( [ __CLASS__, 'tryClearStashedUploads' ] );
                $form->setSubmitTextMsg( 'uploadstash-clear' );