Don't try to store File objects to the upload session
authorTim Starling <tstarling@wikimedia.org>
Fri, 26 Jul 2019 05:07:41 +0000 (15:07 +1000)
committerTim Starling <tstarling@wikimedia.org>
Fri, 26 Jul 2019 06:15:30 +0000 (16:15 +1000)
commit51e837f68f6df7fdc6cb35803e497bfc0532c861
tree775319bf2fd5d089e4ae24653fb6c39858703bed
parent4320a90bd508f010b430dcd7c038964be4d7d28c
Don't try to store File objects to the upload session

File objects can contain closures which can't be serialized.

Instead, add makeWarningsSerializable(), which converts the warnings
to a serializable array. Make ApiUpload::transformWarnings() act on this
serializable array instead. For consistency, ApiUpload::getApiWarnings()
also needs to convert the result of checkWarnings() before transforming
it.

Bug: T228749
Change-Id: I8236aaf3683f93a03a5505803f4638e022cf6d85
includes/api/ApiUpload.php
includes/jobqueue/jobs/AssembleUploadChunksJob.php
includes/upload/UploadBase.php