From: Rob Church Date: Thu, 13 Apr 2006 18:29:18 +0000 (+0000) Subject: (bug 3359) Add hooks on completion of file upload X-Git-Tag: 1.31.0-rc.0~57500 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=6021507111f472c491310f514205fd80424f6241;p=lhc%2Fweb%2Fwiklou.git (bug 3359) Add hooks on completion of file upload --- 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