Manual:$wgProhibitedFileExtensions/ru
Appearance
Files and file uploads: $wgProhibitedFileExtensions | |
---|---|
Files with these extensions will never be allowed as uploads. |
|
Введено в версии: | 1.37.0 (Gerrit change 680806; git #4dae3b1a) |
Удалено в версии: | всё ещё используется |
Допустимые значения: | (array) |
Значение по умолчанию: | (see below) |
Другие настройки: По алфавиту | По функциональности |
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' ]
);
$wgMimeTypeExclusions = array_diff(
$wgMimeTypeExclusions,
[ 'application/x-msdownload' ]
);
This configuration parameter used previously was $wgFileBlacklist .
Default values
Версия MediaWiki: | ≥ 1.41 |
- 1.40.1 (gerrit:961947, phab:T341565)
- 1.39.5 (gerrit:961940, phab:T341565)
$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',
# T341565
'xml',
];
Версии MediaWiki: | 1.37 – 1.40 |
$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'
];
См. также
- The filename-prefix-blacklist system message defines prohibited prefixes, to avoid non-descriptive (usually camera-generated) filenames.