SPQRobin has uploaded a new change for review. https://gerrit.wikimedia.org/r/134509
Change subject: Require MediaWiki:Licenses to enable uploading ...................................................................... Require MediaWiki:Licenses to enable uploading This change checks whether MediaWiki:Licenses has any text. By default it does not, which means by default uploading is disabled. To enable, the page needs to be simply created. The advantage is that some or many small WMF wikis still do not have license options, which is really needed for our copyright requirements. For non-WMF wikis, I think simply creating a page is not much of an extra burden. Any production wiki should ideally set licenses anyway. Change-Id: I465daaff4aed4b484a1f4707fe57d45c0e9ce6cd --- M includes/specials/SpecialUpload.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/09/134509/1 diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 01c0aaf..c9fcdf1 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -153,6 +153,11 @@ throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' ); } + # Check if licenses are configured + if ( wfMessage( 'licenses' )->isDisabled() ) { + throw new ErrorPageError( 'uploaddisabled', 'upload-nolicenses' ); + } + # Check permissions $user = $this->getUser(); $permissionRequired = UploadBase::isAllowed( $user ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 27a08c4..c983f1a 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1260,6 +1260,7 @@ "upload_directory_read_only": "The upload directory ($1) is not writable by the webserver.", "uploaderror": "Upload error", "upload-summary": "", + "upload-nolicenses": "To be able to upload files through this special page, an administrator needs to add one or more license options to the page [[MediaWiki:Licenses]].\n\nUse the following format: <code>* Template name|Label</code>. Use any text to enable uploading without license options.", "upload-recreate-warning": "<strong>Warning: A file by that name has been deleted or moved.</strong>\n\nThe deletion and move log for this page are provided here for convenience:", "uploadtext": "Use the form below to upload files.\nTo view or search previously uploaded files go to the [[Special:FileList|list of uploaded files]], (re)uploads are also logged in the [[Special:Log/upload|upload log]], deletions in the [[Special:Log/delete|deletion log]].\n\nTo include a file in a page, use a link in one of the following forms:\n* <strong><code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.jpg]]</nowiki></code></strong> to use the full version of the file\n* <strong><code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.png|200px|thumb|left|alt text]]</nowiki></code></strong> to use a 200 pixel wide rendition in a box in the left margin with \"alt text\" as description\n* <strong><code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:File.ogg]]</nowiki></code></strong> for directly linking to the file without displaying the file", "upload-permitted": "Permitted file types: $1.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index d0b5e25..ea0d106 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1422,6 +1422,7 @@ "upload_directory_read_only": "Parameters:\n* $1 - directory name", "uploaderror": "Used as section header in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|upload-tryagain|Submit text}}", "upload-summary": "{{doc-specialpagesummary|upload}}", + "upload-nolicenses": "This error is shown on [[Special:Upload]] when no license options are configured on [[MediaWiki:Licenses]].\n\nSee also [[mw:Manual:Image administration]].", "upload-recreate-warning": "Used as warning in [[Special:Upload]].", "uploadtext": "{{doc-important|<code>thumb</code> and <code>left</code> are magic words. Leave them untranslated!}}\nText displayed when uploading a file using [[Special:Upload]].", "upload-permitted": "Used in [[Special:Upload]]. Parameters:\n* $1 - list of file types, defined in the variable [[mw:Special:MyLanguage/Manual:$wgFileExtensions|$wgFileExtensions]]\nSee also:\n* {{msg-mw|Upload-preferred}}\n* {{msg-mw|Upload-prohibited}}", -- To view, visit https://gerrit.wikimedia.org/r/134509 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I465daaff4aed4b484a1f4707fe57d45c0e9ce6cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: SPQRobin <robinp.1...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits