added to the descriptor
$descriptor: (array) the HTMLForm descriptor
-'UploadVerification': additional chances to reject an uploaded file
+'UploadVerification': additional chances to reject an uploaded file. Consider
+ using UploadVerifyFile instead.
string $saveName: destination file name
string $tempName: filesystem path to the temporary file for checks
string &$error: output: message key for message to show if upload canceled
is the message key and the remaining elements are used as parameters to
the message.
+'UploadVerifyFile': extra file verification, based on mime type, etc. Preferred
+ in most cases over UploadVerification.
+object $upload: an instance of UploadBase, with all info about the upload
+object $mime: the uploaded file's mime type, as detected by MediaWiki. Handlers
+ will typically only apply for specific mime types.
+object &$error: output: true if the file is valid. Otherwise, and indexed array
+ representing the problem with the file, where the first element
+ is the message key and the remaining elements are used as parameters to
+ the message.
+
'UploadComplete': Upon completion of a file upload
$uploadBase: UploadBase (or subclass) object. File can be accessed by
$uploadBase->getLocalFile().
if ( $virus ) {
return array( 'uploadvirus', $virus );
}
+
+ wfRunHooks( 'UploadVerifyFile', array( $this, $mime, &$status ) );
+ if ( $status !== true ) {
+ return $status;
+ }
+
wfDebug( __METHOD__ . ": all clear; passing.\n" );
return true;
}