Index: trunk/phase3/includes/upload/UploadFromChunks.php |
— | — | @@ -216,6 +216,7 @@ |
217 | 217 | |
218 | 218 | // append the given chunk to the temporary uploaded file. (if no temporary uploaded file exists created it. |
219 | 219 | function doChunkAppend(){ |
| 220 | + global $wgMaxUploadSize; |
220 | 221 | // if we don't have a mTempAppendPath to generate a file from the chunk packaged var: |
221 | 222 | if( !$this->mTempAppendPath ){ |
222 | 223 | // get temp name: |
— | — | @@ -228,11 +229,17 @@ |
229 | 230 | } |
230 | 231 | return $status; |
231 | 232 | } else { |
| 233 | + //check to make sure we have not expanded beyond $wgMaxUploadSize |
| 234 | + if( ( filesize( $this->mTempAppendPath ) + filesize( $this->mTempPath ) ) > $wgMaxUploadSize ) |
| 235 | + $status = Status::newFatal( 'largefileserver' ); |
| 236 | + |
232 | 237 | if( is_file( $this->getRealPath( $this->mTempAppendPath ) ) ){ |
233 | 238 | $status = $this->appendToUploadFile( $this->mTempAppendPath, $this->mTempPath ); |
234 | 239 | } else { |
235 | 240 | $status = Status::newFatal( 'filenotfound', $this->mTempAppendPath ); |
236 | 241 | } |
| 242 | + |
| 243 | + |
237 | 244 | return $status; |
238 | 245 | } |
239 | 246 | } |