Manuel:$wgMimeTypeExclusions

This page is a translated version of the page Manual:$wgMimeTypeExclusions and the translation is 100% complete.
Types MIME: $wgMimeTypeExclusions
Types MIME à rejeter quand $wgVerifyMimeType est activé.
Introduit dans la version :1.37.0 (Gerrit change 680806; git #4dae3b1a)
Retiré dans la version :Encore utilisé
Valeurs autorisées :(tableau de types MIME (chaînes))
Valeur par défaut :(voir ci-dessous)

Détails

Les fichiers correspondant à ces types MIME ne seront jamais autorisés au téléchargement si $wgVerifyMimeType est activé.

L'ancienne variable était $wgMimeTypeBlacklist .

Valeurs par défaut

Version de MediaWiki :
1.41
$wgMimeTypeExclusions = [
	# Le HTML peut avoir du JavaScript qui capture les cookies et des bogues web
	'text/html',
	# De la même façon avec JavaScript lui-même
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# Les scripts PHP peuvent exécuter du code arbitraire sur le serveur
	'application/x-php', 'text/x-php',
	# Autres types pouvant être interprétés par certains serveurs
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Dangers côté client avec Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Métafichier Windows, vulnérabilité côté client sur certains systèmes
	'application/x-msmetafile',
	# Fichiers qui ressemblent à des fichiers java
	'application/java',
	# fichiers XML en général - T341565
	'application/xml', 'text/xml',
];
Versions de 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',
	# Les applets Java ne sont plus prises en charge par les navigateurs et peuvent contenir du code qui vole les cookies, comme le JavaScript
	'application/java'
];
Versions de 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',
];

Exemple

Si vous souhaitez pouvoir téléverser les fichiers HTML :

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