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.
+* UploadBase:: and UploadFromChunks::stashFileGetKey() and stashSession(),
+ deprecated in 1.28, have been removed. Instead, please use the getFileKey()
+ method on the response from doStashFile().
* …
=== Deprecations in 1.34 ===
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
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 ];
}
* @throws UploadStashNotLoggedInException
*/
public function stashFile( User $user = null ) {
+ wfDeprecated( __METHOD__, '1.28' );
+
return $this->doStashFile( $user );
}
return $file;
}
- /**
- * Stash a file in a temporary directory, returning a key which can be used
- * to find the file again. See stashFile().
- *
- * @deprecated since 1.28
- * @return string File key
- */
- public function stashFileGetKey() {
- wfDeprecated( __METHOD__, '1.28' );
- return $this->doStashFile()->getFileKey();
- }
-
- /**
- * alias for stashFileGetKey, for backwards compatibility
- *
- * @deprecated since 1.28
- * @return string File key
- */
- public function stashSession() {
- wfDeprecated( __METHOD__, '1.28' );
- return $this->doStashFile()->getFileKey();
- }
-
/**
* If we've modified the upload file we need to manually remove it
* on exit to clean up.
*/
public function stashFile( User $user = null ) {
wfDeprecated( __METHOD__, '1.28' );
- $this->verifyChunk();
- return parent::stashFile( $user );
- }
- /**
- * @inheritDoc
- * @throws UploadChunkVerificationException
- * @deprecated since 1.28
- */
- public function stashFileGetKey() {
- wfDeprecated( __METHOD__, '1.28' );
$this->verifyChunk();
- return parent::stashFileGetKey();
- }
-
- /**
- * @inheritDoc
- * @throws UploadChunkVerificationException
- * @deprecated since 1.28
- */
- public function stashSession() {
- wfDeprecated( __METHOD__, '1.28' );
- $this->verifyChunk();
- return parent::stashSession();
+ return parent::stashFile( $user );
}
/**