http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84658
Revision: 84658
Author: kaldari
Date: 2011-03-24 01:25:08 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
some better title filtering
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-24 00:48:43 UTC
(rev 84657)
+++ trunk/extensions/UploadWizard/resources/mw.Title.js 2011-03-24 01:25:08 UTC
(rev 84658)
@@ -42,13 +42,13 @@
var ext = null;
/**
- * strip every illegal char we can think of
+ * strip every illegal char we can think of: control chars,
colon, less than, greater than, 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\s]+/g, '_' );
+ return s.replace(
/[\x00-\x1f\x3a\x3c\x3e\x7f\s]+/g, '_' );
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs