$wgIllegalFileChars configurable to add chars for filename automatically converted to "-".
* this breaks interlanguage links
*/
$wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
+$wgIllegalFileChars = ":"; // These are additional characters that should be replaced with '-' in file names
/**
* The external URL protocols
* @param $name Mixed: filename to process
*/
function wfStripIllegalFilenameChars( $name ) {
+ global $wgIllegalFileChars;
$name = wfBaseName( $name );
- $name = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $name );
+ $name = preg_replace("/[^".Title::legalChars()."]".($wgIllegalFileChars ? "|[".$wgIllegalFileChars."]":"")."/",'-',$name);
return $name;
}