From 6021507111f472c491310f514205fd80424f6241 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 13 Apr 2006 18:29:18 +0000 Subject: [PATCH] (bug 3359) Add hooks on completion of file upload --- RELEASE-NOTES | 2 +- docs/hooks.txt | 3 +++ includes/SpecialUpload.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d5eec3e745..a212fbc0ed 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -61,7 +61,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN magic words * (bug 5403) Fix Special:Newpages RSS/Atom feeds * Reject malformed addresses in X-Forwarded-For entries - +* (bug 3359) Add hooks on completion of file upload == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index 50ace1ef85..64dce31ce0 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -380,6 +380,9 @@ 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 +'UploadComplete': Upon completion of a file upload +$image: Image object representing the file that was uploaded + 'UserCan': To interrupt/advise the "user can do X to Y article" check $title: Title object being checked against $user : Current user object diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 31c4f3c257..367b937a52 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -331,6 +331,7 @@ class UploadForm { if ( $success ) { $this->showSuccess(); + wfRunHooks( 'UploadComplete', &$img ); } else { // Image::recordUpload() fails if the image went missing, which is // unlikely, hence the lack of a specialised message -- 2.20.1