Handbuch:$wgProhibitedFileExtensions

This page is a translated version of the page Manual:$wgProhibitedFileExtensions and the translation is 38% complete.
Other languages:
Dateien und Datei-Uploads: $wgProhibitedFileExtensions
Dateien mit diesen Erweiterungen werden nie als Uploads erlaubt werden.
Eingeführt in Version:1.37.0 (Gerrit change 680806; git #4dae3b1a)
Entfernt in Version:weiterhin vorhanden
Erlaubte Werte:(array)
Standardwert:(siehe unten)

Details

Files with these extensions will never be allowed as uploads.

$wgProhibitedFileExtensions 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';
$wgProhibitedFileExtensions = array_diff(
    $wgProhibitedFileExtensions,
    [ 'exe' ] 
);
$wgMimeTypeBlacklist = array_diff(
    $wgMimeTypeBlacklist, 
    [ 'application/x-msdownload' ]
);

This configuration parameter used previously was wgFileBlacklist .

Standardwerte

MediaWiki Version:
1.37
/**
 * 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.
 */
$wgProhibitedFileExtensions = [
	# 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'
];

Siehe auch

  • The filename-prefix-blacklist system message defines prohibited prefixes, to avoid non-descriptive (usually camera-generated) filenames.