$form = $this->getUploadForm( $warningHtml, $sessionKey, /* $hideIgnoreWarning */ true );
$form->setSubmitText( $this->msg( 'upload-tryagain' )->text() );
- $form->addButton( 'wpUploadIgnoreWarning', $this->msg( 'ignorewarning' )->text() );
- $form->addButton( 'wpCancelUpload', $this->msg( 'reuploaddesc' )->text() );
+ $form->addButton( array(
+ 'name' => 'wpUploadIgnoreWarning',
+ 'value' => $this->msg( 'ignorewarning' )->text()
+ ) );
+ $form->addButton( array(
+ 'name' => 'wpCancelUpload',
+ 'value' => $this->msg( 'reuploaddesc' )->text()
+ ) );
$this->showUploadForm( $form );
}
}
+ // This is as late as we can throttle, after expected issues have been handled
+ if ( UploadBase::isThrottled( $this->getUser() ) ) {
+ $this->showRecoverableUploadError(
+ $this->msg( 'actionthrottledtext' )->escaped()
+ );
+ return;
+ }
+
// Get the page text if this is not a reupload
if ( !$this->mForReUpload ) {
$pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
);
}
- $this->mMaxUploadSize['file'] = UploadBase::getMaxUploadSize( 'file' );
- # Limit to upload_max_filesize unless we are running under HipHop and
- # that setting doesn't exist
- if ( !wfIsHHVM() ) {
- $this->mMaxUploadSize['file'] = min( $this->mMaxUploadSize['file'],
- wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ),
- wfShorthandToInteger( ini_get( 'post_max_size' ) )
- );
- }
+ $this->mMaxUploadSize['file'] = min(
+ UploadBase::getMaxUploadSize( 'file' ),
+ UploadBase::getMaxPhpUploadSize()
+ );
$help = $this->msg( 'upload-maxfilesize',
$this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['file'] )