Open main menu

Manuel:$wgFileBlacklist

This page is a translated version of the page Manual:$wgFileBlacklist and the translation is 25% complete.
Other languages:
English • ‎español • ‎français • ‎italiano • ‎magyar • ‎polski • ‎русский • ‎తెలుగు • ‎中文 • ‎日本語
Téléversements: $wgFileBlacklist
Files with these extensions will never be allowed as uploads.
Introduit dans la version :1.2.0
Retiré dans la version :Encore utilisé
Valeurs autorisées :(tableau)
Valeur par défaut :(voir ci-dessous)

Détails

Files with these extensions will never be allowed as uploads.

This is the default value:

/**
 * Files with these extensions will never be allowed as uploads.
 * An array of file extensions to blacklist. You should append to this array
 * if you want to blacklist additional files.
 */
$wgFileBlacklist = [
  # HTML may contain cookie-stealing JavaScript and web bugs
	'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
  # PHP scripts may execute arbitrary code on the server
	'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
  # Other types that may be interpreted by some servers
	'shtml', 'jhtml', 'pl', 'py', 'cgi',
  # May contain harmful executables for Windows victims
	'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' ];

$wgFileBlacklist overrides $wgFileExtensions , so you must remove an extension from the blacklist before you can upload files that have it. For instance, to allow users to upload executables, add this to LocalSettings.php :

$wgFileExtensions[] = 'exe';
$wgFileBlacklist = array_diff( $wgFileBlacklist, array ('exe') );

See also