jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382749 )

Change subject: Disallow most file types from upload to enwikivoyage
......................................................................


Disallow most file types from upload to enwikivoyage

This disallows all audio, video and media file types (and some image
types) that we normally allow on all wikis. The only allowed file
types that remain are: jpg/jpeg, gif, png, tif/tiff, svg.

Added 'wmgFileBlacklist' to allow easy configuration of this per-wiki.

Bug: T176647
Change-Id: I6c625954b4a24e37289447335b81221177cba3bd
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 14 insertions(+), 3 deletions(-)

Approvals:
  Zfilipin: Looks good to me, approved
  jenkins-bot: Verified
  Zoranzoki21: Looks good to me, but someone else must approve



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 62cfa4e..c932ae9 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -491,9 +491,6 @@
 $wgImageMagickConvertCommand    = '/usr/local/bin/mediawiki-firejail-convert';
 $wgSharpenParameter = '0x0.8'; # for IM>6.5, T26857
 
-$wgFileBlacklist[] = 'txt';
-$wgFileBlacklist[] = 'mht';
-
 if ( $wmgUsePagedTiffHandler ) {
        wfLoadExtension( 'PagedTiffHandler' );
 }
@@ -504,6 +501,7 @@
 $wgMaxAnimatedGifArea = 10e7; // 100MP
 
 $wgFileExtensions = array_merge( $wgFileExtensions, $wmgFileExtensions );
+$wgFileBlacklist = array_merge( $wgFileBlacklist, $wmgFileBlacklist );
 
 if ( isset( $wmgUploadStashMaxAge ) ) {
        $wgUploadStashMaxAge = $wmgUploadStashMaxAge;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 21015d8..3638a1d 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19126,6 +19126,7 @@
 ],
 
 'wmgFileExtensions' => [
+       // Note that 'wmgPrivateWikiUploads' allows additional file extensions 
on some wikis
        'default' => [
                'xcf',
                'pdf',
@@ -19144,6 +19145,18 @@
        ],
 ],
 
+'wmgFileBlacklist' => [
+       'default' => [
+               'txt',
+               'mht',
+       ],
+       '+enwikivoyage' => [
+               // Some of these are allowed by MediaWiki core or extensions 
and it is not sufficient
+               // to remove them from 'wmgFileExtensions'
+               'webp', 'xcf', 'pdf', 'mid', 'ogg', 'ogv', 'djvu', 'oga', 
'flac', 'opus', 'wav', 'webm',
+       ],
+],
+
 'wgRedirectSources' => [
        'default' => false,
        'donatewiki' => '!^https?://donate\.wikimedia\.org/!',

-- 
To view, visit https://gerrit.wikimedia.org/r/382749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c625954b4a24e37289447335b81221177cba3bd
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Urbanecm <martin.urba...@wikimedia.cz>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: Zoranzoki21 <zorandori4...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to