jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/326944 )
Change subject: Do not lose message parameters in UploadFromChunks::verifyChunk() ...................................................................... Do not lose message parameters in UploadFromChunks::verifyChunk() This code is gross, and my changes do not really make it better, but it works more correctly more often. Bug: T147720 Change-Id: If9ce05045ada1e3f55e031639e4c4ebc2a216de8 --- M includes/upload/UploadFromChunks.php 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Anomie: Looks good to me, approved diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 08cf434..449fc05 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -222,7 +222,7 @@ $this->verifyChunk(); $this->mTempPath = $oldTemp; } catch ( UploadChunkVerificationException $e ) { - return Status::newFatal( $e->getMessage() ); + return Status::newFatal( $e->msg ); } $status = $this->outputChunk( $chunkPath ); if ( $status->isGood() ) { @@ -364,7 +364,7 @@ $this->mDesiredDestName = $oldDesiredDestName; $this->mTitle = false; if ( is_array( $res ) ) { - throw new UploadChunkVerificationException( $res[0] ); + throw new UploadChunkVerificationException( $res ); } } } @@ -376,4 +376,10 @@ } 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 ) + ->inLanguage( 'en' )->useDatabase( false )->text() ); + } } -- To view, visit https://gerrit.wikimedia.org/r/326944 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9ce05045ada1e3f55e031639e4c4ebc2a216de8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Anomie <bjor...@wikimedia.org> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits