Merge "mw.Title: Use $wgIllegalFileChars for file title checking"

This commit is contained in:
jenkins-bot 2016-07-31 05:03:13 +00:00 committed by Gerrit Code Review
commit 239659fe4c
2 changed files with 4 additions and 1 deletions

View file

@ -66,6 +66,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
}
}
$illegalFileChars = $conf->get( 'IllegalFileChars' );
// Build list of variables
$vars = [
'wgLoadScript' => wfScript( 'load' ),
@ -107,6 +109,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
'wgResourceLoaderMaxQueryLength' => $conf->get( 'ResourceLoaderMaxQueryLength' ),
'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ),
'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
'wgResourceLoaderLegacyModules' => self::getLegacyModules(),

View file

@ -213,7 +213,7 @@
},
// slash, colon (not supported by file systems like NTFS/Windows, Mac OS 9 [:], ext4 [/])
{
pattern: /[:\/#]/g,
pattern: new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + ']', 'g' ),
replace: '-',
fileRule: true
},