use tabs. for consistant whitespaces
authorJan Gerber <j@users.mediawiki.org>
Tue, 2 Aug 2011 11:01:01 +0000 (11:01 +0000)
committerJan Gerber <j@users.mediawiki.org>
Tue, 2 Aug 2011 11:01:01 +0000 (11:01 +0000)
includes/api/ApiUpload.php

index a891b2d..4769f92 100644 (file)
@@ -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