Merge "ApiComparePages: Don't error with no prev/next rev"
[lhc/web/wiklou.git] / includes / upload / UploadFromChunks.php
index 68bcb9d..58541b2 100644 (file)
@@ -54,11 +54,7 @@ class UploadFromChunks extends UploadFromFile {
                if ( $stash ) {
                        $this->stash = $stash;
                } else {
-                       if ( $user ) {
-                               wfDebug( __METHOD__ . " creating new UploadFromChunks instance for " . $user->getId() . "\n" );
-                       } else {
-                               wfDebug( __METHOD__ . " creating new UploadFromChunks instance with no user\n" );
-                       }
+                       wfDebug( __METHOD__ . " creating new UploadFromChunks instance for " . $user->getId() . "\n" );
                        $this->stash = new UploadStash( $this->repo, $this->user );
                }
        }
@@ -210,7 +206,7 @@ class UploadFromChunks extends UploadFromFile {
                // 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 {
@@ -422,9 +418,9 @@ class UploadChunkFileException extends MWException {
 
 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() );
        }
 }