Merge "mw.Title: Use $wgIllegalFileChars for file title checking"
This commit is contained in:
commit
239659fe4c
2 changed files with 4 additions and 1 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue