MarkAHershberger has uploaded a new change for review. https://gerrit.wikimedia.org/r/64480
Change subject: Disable chunked uploads for the 1.21 release. ...................................................................... Disable chunked uploads for the 1.21 release. Change-Id: I727d973abc3d791b8bfc174c674c35f0432d382c --- M RELEASE-NOTES-1.21 M includes/DefaultSettings.php M includes/api/ApiUpload.php 3 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/64480/1 diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 6b4ff04..d099c50 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -220,6 +220,7 @@ * (bug 47202) wikibits: FF2Fixes.css should not be loaded in Firefox 20. === API changes in 1.21 === +* Chunked uploads are disabled by default. They can be enabled with $ * prop=revisions can now report the contentmodel and contentformat. See docs/contenthandler.txt. * action=edit and action=parse now support contentmodel and contentformat diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0ad4362..9238821 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -336,6 +336,13 @@ $wgEnableAsyncUploads = false; /** + * Allow chunked uploads. This should only really be needed if you + * use the UploadWizard extension or allow huge file uploads. + * https://www.mediawiki.org/wiki/API:Upload#Chunked_uploading + */ +$wgAllowChunkedUploads = false; + +/** * These are additional characters that should be replaced with '-' in filenames */ $wgIllegalFileChars = ":"; diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 2dcf392..cb98d29 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -352,6 +352,8 @@ } if ( $this->mParams['chunk'] ) { + $this->checkChunkedEnabled(); + // Chunk upload $this->mUpload = new UploadFromChunks(); if( isset( $this->mParams['filekey'] ) ) { @@ -645,6 +647,13 @@ } } + protected function checkChunkedEnabled() { + global $wgAllowChunkedUploads; + if ( !$wgAllowChunkedUploads ) { + $this->dieUsage( 'Chunked uploads disabled', 'chunkeduploaddisabled' ); + } + } + public function mustBePosted() { return true; } @@ -801,6 +810,7 @@ array( 'code' => 'publishfailed', 'info' => 'Publishing of stashed file failed' ), array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ), array( 'code' => 'asynccopyuploaddisabled', 'info' => 'Asynchronous copy uploads disabled' ), + array( 'code' => 'chunkeduploaddisabled', 'info' => 'Chunked uploads disabled' ), array( 'fileexists-forbidden' ), array( 'fileexists-shared-forbidden' ), ) -- To view, visit https://gerrit.wikimedia.org/r/64480 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I727d973abc3d791b8bfc174c674c35f0432d382c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_21 Gerrit-Owner: MarkAHershberger <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
