http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96591

Revision: 96591
Author:   neilk
Date:     2011-09-08 18:29:26 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
added test to make sure string value is obtained in _stripText()

Modified Paths:
--------------
    trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js

Modified: trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js
===================================================================
--- trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js 
2011-09-08 18:08:40 UTC (rev 96590)
+++ trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js 
2011-09-08 18:29:26 UTC (rev 96591)
@@ -125,8 +125,11 @@
         * @param {String}
         * @return string stripped of some characters, trimmed
         */
-       function _stripText( s ) {
-                return $j.trim( s.replace( 
/[\x00-\x1f\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f]+/g, '' ) );
+       function _stripText( s ) { 
+               if ( typeof s !== 'string' ) {
+                       throw new Error( '_stripText() argument must be a 
string' );
+               }
+               return $j.trim( s.replace( 
/[\x00-\x1f\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f]+/g, '' ) );
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to