From 5acb37d00e84b191ae02943493ff4a0c97e2af89 Mon Sep 17 00:00:00 2001 From: Jan Gerber Date: Tue, 2 Aug 2011 11:01:01 +0000 Subject: [PATCH] use tabs. for consistant whitespaces --- includes/api/ApiUpload.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index a891b2dedf..4769f92a91 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -91,9 +91,9 @@ class ApiUpload extends ApiBase { if( $this->mParams['filesize'] > $maxSize ) { $this->dieUsage( 'The file you submitted was too large', 'file-too-large' ); } - } else { + } else { $this->verifyUpload(); - } + } // Check if the user has the rights to modify or overwrite the requested title @@ -122,25 +122,25 @@ class ApiUpload extends ApiBase { $result['warnings']['stashfailed'] = $e->getMessage(); } } elseif ( $this->mParams['chunk'] ) { - $result['result'] = 'Continue'; + $result['result'] = 'Continue'; $chunk = $request->getFileTempName( 'chunk' ); $chunkSize = $request->getFileSize( 'chunk' ); - if ($this->mParams['offset'] == 0) { + if ($this->mParams['offset'] == 0) { $result['filekey'] = $this->performStash(); - } else { - $status = $this->mUpload->appendChunk($chunk, $chunkSize, - $this->mParams['offset']); - if ( !$status->isGood() ) { - $this->dieUsage( $status->getWikiText(), 'stashfailed' ); - } else { - $result['filekey'] = $this->mParams['filekey']; - if($this->mParams['offset'] + $chunkSize == $this->mParams['filesize']) { - $this->mUpload->finalizeFile(); - $result['result'] = 'Done'; - } - } - } - $result['offset'] = $this->mParams['offset'] + $chunkSize; + } else { + $status = $this->mUpload->appendChunk($chunk, $chunkSize, + $this->mParams['offset']); + if ( !$status->isGood() ) { + $this->dieUsage( $status->getWikiText(), 'stashfailed' ); + } else { + $result['filekey'] = $this->mParams['filekey']; + if($this->mParams['offset'] + $chunkSize == $this->mParams['filesize']) { + $this->mUpload->finalizeFile(); + $result['result'] = 'Done'; + } + } + } + $result['offset'] = $this->mParams['offset'] + $chunkSize; } elseif ( $this->mParams['stash'] ) { // Some uploads can request they be stashed, so as not to publish them immediately. // In this case, a failure to stash ought to be fatal -- 2.20.1