MediaWiki master
MediaWiki\Hook\UploadVerifyFileHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onUploadVerifyFile ( $upload, $mime, &$error)
 Use this hook to perform extra file verification, based on MIME type, etc.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "UploadVerifyFile" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 15 of file UploadVerifyFileHook.php.

Member Function Documentation

◆ onUploadVerifyFile()

MediaWiki\Hook\UploadVerifyFileHook::onUploadVerifyFile ( $upload,
$mime,
& $error )

Use this hook to perform extra file verification, based on MIME type, etc.

Since
1.35
Parameters
UploadBase$uploadInstance of UploadBase, with all info about the upload
string$mimeUploaded file's MIME type, as detected by MediaWiki. Handlers will typically only apply for specific MIME types.
bool | array | MessageSpecifier&$errorOutput: true if the file is valid. Otherwise, set this to the reason in the form of [ messagename, param1, param2, ... ] or a MessageSpecifier instance. (You might want to use ApiMessage to provide machine -readable details for the API.)
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: