Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -91,9 +91,9 @@ |
92 | 92 | if( $this->mParams['filesize'] > $maxSize ) { |
93 | 93 | $this->dieUsage( 'The file you submitted was too large', 'file-too-large' ); |
94 | 94 | } |
95 | | - } else { |
| 95 | + } else { |
96 | 96 | $this->verifyUpload(); |
97 | | - } |
| 97 | + } |
98 | 98 | |
99 | 99 | |
100 | 100 | // Check if the user has the rights to modify or overwrite the requested title |
— | — | @@ -122,25 +122,25 @@ |
123 | 123 | $result['warnings']['stashfailed'] = $e->getMessage(); |
124 | 124 | } |
125 | 125 | } elseif ( $this->mParams['chunk'] ) { |
126 | | - $result['result'] = 'Continue'; |
| 126 | + $result['result'] = 'Continue'; |
127 | 127 | $chunk = $request->getFileTempName( 'chunk' ); |
128 | 128 | $chunkSize = $request->getFileSize( 'chunk' ); |
129 | | - if ($this->mParams['offset'] == 0) { |
| 129 | + if ($this->mParams['offset'] == 0) { |
130 | 130 | $result['filekey'] = $this->performStash(); |
131 | | - } else { |
132 | | - $status = $this->mUpload->appendChunk($chunk, $chunkSize, |
133 | | - $this->mParams['offset']); |
134 | | - if ( !$status->isGood() ) { |
135 | | - $this->dieUsage( $status->getWikiText(), 'stashfailed' ); |
136 | | - } else { |
137 | | - $result['filekey'] = $this->mParams['filekey']; |
138 | | - if($this->mParams['offset'] + $chunkSize == $this->mParams['filesize']) { |
139 | | - $this->mUpload->finalizeFile(); |
140 | | - $result['result'] = 'Done'; |
141 | | - } |
142 | | - } |
143 | | - } |
144 | | - $result['offset'] = $this->mParams['offset'] + $chunkSize; |
| 131 | + } else { |
| 132 | + $status = $this->mUpload->appendChunk($chunk, $chunkSize, |
| 133 | + $this->mParams['offset']); |
| 134 | + if ( !$status->isGood() ) { |
| 135 | + $this->dieUsage( $status->getWikiText(), 'stashfailed' ); |
| 136 | + } else { |
| 137 | + $result['filekey'] = $this->mParams['filekey']; |
| 138 | + if($this->mParams['offset'] + $chunkSize == $this->mParams['filesize']) { |
| 139 | + $this->mUpload->finalizeFile(); |
| 140 | + $result['result'] = 'Done'; |
| 141 | + } |
| 142 | + } |
| 143 | + } |
| 144 | + $result['offset'] = $this->mParams['offset'] + $chunkSize; |
145 | 145 | } elseif ( $this->mParams['stash'] ) { |
146 | 146 | // Some uploads can request they be stashed, so as not to publish them immediately. |
147 | 147 | // In this case, a failure to stash ought to be fatal |