// Check if the uploaded file is sane
if ( $this->mParams['chunk'] ) {
- $maxSize = $this->mUpload->getMaxUploadSize( );
+ $maxSize = $this->mUpload->getMaxUploadSize();
if( $this->mParams['filesize'] > $maxSize ) {
$this->dieUsage( 'The file you submitted was too large', 'file-too-large' );
}
array(
'filename' => $this->mParams['filename'],
'filekey' => $this->mParams['filekey'],
- 'session' => $this->getRequest()->exportUserSession(),
- 'userid' => $this->getUser()->getId()
+ 'session' => $this->getContext()->exportSession()
)
) );
if ( $ok ) {
/**
* Performs file verification, dies on error.
*/
- protected function verifyUpload( ) {
- $verification = $this->mUpload->verifyUpload( );
+ protected function verifyUpload() {
+ $verification = $this->mUpload->verifyUpload();
if ( $verification['status'] === UploadBase::OK ) {
return;
- } else {
- return $this->checkVerification( $verification );
}
+
+ $this->checkVerification( $verification );
}
/**
protected function checkVerification( array $verification ) {
global $wgFileExtensions;
- // TODO: Move them to ApiBase's message map
+ // @todo Move them to ApiBase's message map
switch( $verification['status'] ) {
// Recoverable errors
case UploadBase::MIN_LENGTH_PARTNAME:
'comment' => $this->mParams['comment'],
'text' => $this->mParams['text'],
'watch' => $watch,
- 'session' => $this->getRequest()->exportUserSession(),
- 'userid' => $this->getUser()->getId()
+ 'session' => $this->getContext()->exportSession()
)
) );
if ( $ok ) {