UploadBase: Set mFileSize, if given, even if mTempPath is unknown
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 20 Mar 2016 07:24:29 +0000 (08:24 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sun, 20 Mar 2016 07:24:29 +0000 (08:24 +0100)
commit93d65f2968b76c9b7685ee2c44c5297a7a2a78a2
tree133d18cf624949274929a38fe42bcb018ecfe524
parentf2a160f777cc74be64707bedbf2a63d856b34692
UploadBase: Set mFileSize, if given, even if mTempPath is unknown

When uploading a file from stash using the action=upload API, with
async=1, UploadFromStash is initialized without initializing a temp
file. dcb5ec5cbf92b9a07f0776b9c194183a13400193 accidentally made it so
that the given file size is ignored if there's no path. This caused
validity checks to fail (because mFileSize is null) and action=upload
to also fail with cryptic 'emptyfile' warning.

This made it impossible to upload files bigger than 10 MB using
UploadWizard, as it uses the async mode for them.

Bug: T130238
Change-Id: Ie35a66a565a370fe9adc66d5fee0866c4d51470e
includes/upload/UploadBase.php