Manual:$wgMimeTypeExclusions

This page is a translated version of the page Manual:$wgMimeTypeExclusions and the translation is 74% complete.
MIME タイプ: $wgMimeTypeExclusions
$wgVerifyMimeType が有効な場合の、許可しない MIME タイプ。
導入されたバージョン:1.37.0 (Gerrit change 680806; git #4dae3b1a)
除去されたバージョン:使用中
許容される値:(MIME タイプ (文字列) の配列)
既定値:(下記参照)

詳細

$wgVerifyMimeType が有効な場合、これらの MIME タイプのファイルのアップロードを禁止します。

この変数は以前は $wgMimeTypeBlacklist でした。

既定値

MediaWiki バージョン:
1.41
$wgMimeTypeExclusions = [
	# HTML は、Cookie を盗む JavaScript や Web のバグを含む場合がある
	'text/html',
	# Similarly with JavaScript itself
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP スクリプトは、サーバー上で任意のコードを実行できてしまう
	'application/x-php', 'text/x-php',
	# 一部のサーバーで解釈できる場合があるその他のファイル形式
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Internet Explorer 向けのクライアント側の脅威
	'text/scriptlet', 'application/x-msdownload',
	# Windows メタファイル。一部のシステムでクライアント側の脆弱性になる
	'application/x-msmetafile',
	# Files that look like java files
	'application/java',
	# XML files generally - T341565
	'application/xml', 'text/xml',
];
MediaWiki バージョン:
1.39 – 1.40
$wgMimeTypeExclusions = [
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html',
	# Similarly with JavaScript itself
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
	# Java applets are no longer supported by browsers and may contain cookie-stealing code, similarly to JavaScript
	'application/java'
];
MediaWiki バージョン:
1.37 – 1.38
$wgMimeTypeExclusions = [
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html',
	# Similarly with JavaScript itself
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
];

If you wanted to allow html files to be uploaded:

$wgFileExtensions[] = 'html';
$wgProhibitedFileExtensions = array_diff( $wgProhibitedFileExtensions, array ('html') );
$wgMimeTypeExclusions = array_diff( $wgMimeTypeExclusions, array ('text/html') );