'UploadVerification': additional chances to reject an uploaded file
string $saveName: destination file name
string $tempName: filesystem path to the temporary file for checks
-string &$error: output: HTML error to show if upload canceled by returning false
+string &$error: output: message key for message to show if upload canceled
+ by returning false. May also be an array, 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
$this->uploadError( wfMsgExt( $code, 'parseinline', $details['details'] ) );
break;
case UploadBase::HOOK_ABORTED:
- $error = $details['error'];
- $this->uploadError( wfMsgExt( $error, 'parseinline' ) );
+ if ( is_array( $details['error'] ) ) { # allow hooks to return error details in an array
+ $args = $details['error'];
+ $error = array_shift( $args );
+ } else {
+ $error = $details['error'];
+ $args = null;
+ }
+
+ $this->uploadError( wfMsgExt( $error, 'parseinline', $args ) );
break;
default:
throw new MWException( __METHOD__ . ": Unknown value `{$details['status']}`" );