Add "upload" type to API
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 26 Feb 2013 21:45:37 +0000 (13:45 -0800)
committerYuri Astrakhan <yuriastrakhan@gmail.com>
Sat, 2 Mar 2013 21:12:53 +0000 (16:12 -0500)
commitf8d1bf2ad124bf804d87f300a39f43a7450b4d23
treeb9e7e0dda5b97f6a17d7ef684d2c9f2a6628ce47
parent59c16a66d95c4aecc34e908be15f0b81c53baffe
Add "upload" type to API

If a file upload is not formatted correctly for PHP to recognize it as a
file upload rather than a regular field, the API will wind up trying to
load the file contents as a text field. Since these file contents are
often a large binary file, this will tend to run out of memory trying to
apply Unicode normalization.

To prevent this and to allow for a helpful error message, mark
parameters that are supposed to be file uploads.

Bug: 44909
Change-Id: Ia4586953e2ad2d72d08852689e060e39e7920d50
RELEASE-NOTES-1.21
includes/api/ApiBase.php
includes/api/ApiImport.php
includes/api/ApiMain.php
includes/api/ApiUpload.php