Introduce new hook UploadVerifyUpload to allow preventing file uploads
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 17 Jun 2016 15:20:11 +0000 (17:20 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 22 Jun 2016 21:38:50 +0000 (23:38 +0200)
commit8f2acfcde440b6476a8139d72765b6dda6b46842
treea5a8b3d3b90ceb8a6f3fca754e9ede0516e3ddee
parentfc8481847a89ff82d0231b4e79c3002f6e816cde
Introduce new hook UploadVerifyUpload to allow preventing file uploads

The new hook runs at the beginning of UploadBase::performUpload().
Unlike the existing UploadVerifyFile hook, the new one provides the
information about the file description page being created, and the
user who is performing the upload. It also does not run for uploads
to stash.

The action=upload API and Special:Upload have been changed to treat
errors from UploadBase::performUpload() as recoverable, which means
that they will attempt to stash the file (previously they would require
the user to upload it again). This is mostly intended for errors from
the new hook, but I think it makes sense for the existing ones, which
are mostly transient filesystem erorrs.

Bug: T89302
Change-Id: Ie68801b307de8456e1753ba54a29c34c8063bc36
docs/hooks.txt
includes/api/ApiUpload.php
includes/specials/SpecialUpload.php
includes/upload/UploadBase.php