Drop the UploadVerification hook, deprecated in 1.28
authorJames D. Forrester <jforrester@wikimedia.org>
Tue, 2 Jul 2019 21:49:49 +0000 (14:49 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Fri, 19 Jul 2019 20:50:13 +0000 (13:50 -0700)
Change-Id: Ic1917fc95223cbf97845c2702ddf98accf8ba9c2

RELEASE-NOTES-1.34
docs/hooks.txt
includes/upload/UploadBase.php

index 4b28012..c470fff 100644 (file)
@@ -305,6 +305,8 @@ because of Phabricator reports.
   deprecated since 1.33.
 * The static properties mw.Api.errors and mw.Api.warnings, deprecated in 1.29,
   have been removed.
+* The UploadVerification hook, deprecated in 1.28, has been removed. Instead,
+  use the UploadVerifyFile hook.
 * …
 
 === Deprecations in 1.34 ===
index 756ba4e..8e274ed 100644 (file)
@@ -3569,14 +3569,6 @@ $props: (array|null) File properties, as returned by
   MessageSpecifier instance (you might want to use ApiMessage to provide machine
   -readable details for the API).
 
-'UploadVerification': DEPRECATED since 1.28! Use UploadVerifyFile instead.
-Additional chances to reject an uploaded file.
-$saveName: (string) destination file name
-$tempName: (string) filesystem path to the temporary file for checks
-&$error: (string) 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.
-
 'UploadVerifyFile': extra file verification, based on MIME type, etc. Preferred
 in most cases over UploadVerification.
 $upload: (object) an instance of UploadBase, with all info about the upload
index 41c42ce..3d84ba4 100644 (file)
@@ -379,13 +379,6 @@ abstract class UploadBase {
                        return $result;
                }
 
-               $error = '';
-               if ( !Hooks::run( 'UploadVerification',
-                       [ $this->mDestName, $this->mTempPath, &$error ], '1.28' )
-               ) {
-                       return [ 'status' => self::HOOK_ABORTED, 'error' => $error ];
-               }
-
                return [ 'status' => self::OK ];
        }