}
}
+ /**
+ * @inheritDoc
+ */
+ public function tryStashFile( User $user, $isPartial = false ) {
+ try {
+ $this->verifyChunk();
+ } catch ( UploadChunkVerificationException $e ) {
+ return Status::newFatal( $e->msg );
+ }
+
+ return parent::tryStashFile( $user, $isPartial );
+ }
+
+ /**
+ * @inheritDoc
+ * @throws UploadChunkVerificationException
+ * @deprecated since 1.28 Use tryStashFile() instead
+ */
+ 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();
+ }
+
/**
* Calls the parent doStashFile and updates the uploadsession table to handle "chunks"
*
$this->mChunkIndex = 0;
$this->mOffset = 0;
- $this->verifyChunk();
// Create a local stash target
$this->mStashFile = parent::doStashFile( $user );
// Update the initial file offset (based on file size)
// override doStashFile() with completely different functionality in this class...
$error = $this->runUploadStashFileHook( $this->user );
if ( $error ) {
- call_user_func_array( [ $status, 'fatal' ], $error );
+ $status->fatal( ...$error );
return $status;
}
try {
class UploadChunkVerificationException extends MWException {
public $msg;
- public function __construct( $res ) {
- $this->msg = call_user_func_array( 'wfMessage', $res );
- parent::__construct( call_user_func_array( 'wfMessage', $res )
+ public function __construct( array $res ) {
+ $this->msg = wfMessage( ...$res );
+ parent::__construct( wfMessage( ...$res )
->inLanguage( 'en' )->useDatabase( false )->text() );
}
}