r84658 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84657‎ | r84658 | r84659 >
Date:01:25, 24 March 2011
Author:kaldari
Status:deferred
Tags:
Comment:
some better title filtering
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.Title.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.Title.js
@@ -42,13 +42,13 @@
4343 var ext = null;
4444
4545 /**
46 - * strip every illegal char we can think of
 46+ * strip every illegal char we can think of: control chars, colon, less than, greater than, whitespace
4747 * yes, I know this leaves other insanity intact, like unicode bidi chars, but let's start someplace
4848 * @return {String}
4949 */
5050 function clean( s ) {
5151 if ( mw.isDefined( s ) ) {
52 - return s.replace( /[\x00-\x1f\s]+/g, '_' );
 52+ return s.replace( /[\x00-\x1f\x3a\x3c\x3e\x7f\s]+/g, '_' );
5353 }
5454 }
5555

Status & tagging log