http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84723
Revision: 84723
Author: kaldari
Date: 2011-03-25 01:33:12 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
better title sanitizing
Modified Paths:
--------------
trunk/extensions/UploadWizard/resources/mw.Title.js
Modified: trunk/extensions/UploadWizard/resources/mw.Title.js
===================================================================
--- trunk/extensions/UploadWizard/resources/mw.Title.js 2011-03-25 01:05:35 UTC
(rev 84722)
+++ trunk/extensions/UploadWizard/resources/mw.Title.js 2011-03-25 01:33:12 UTC
(rev 84723)
@@ -42,13 +42,13 @@
var ext = null;
/**
- * strip every illegal char we can think of: control chars,
colon, less than, greater than, whitespace
+ * strip some illegal chars: control chars, colon, less than,
greater than, brackets, braces, pipe, whitespace
* yes, I know this leaves other insanity intact, like unicode
bidi chars, but let's start someplace
* @return {String}
*/
function clean( s ) {
if ( mw.isDefined( s ) ) {
- return s.replace(
/[\x00-\x1f\x3a\x3c\x3e\x7f\s]+/g, '_' );
+ return s.replace(
/[\x00-\x1f\x23\x3a\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' );
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs