RCFilters: Preference length is in bytes, so use $.byteLength
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.Controller.js
index f37229f..ee74ac5 100644 (file)
                // Stringify state
                stringified = JSON.stringify( state );
 
-               if ( stringified.length > 65535 ) {
+               if ( $.byteLength( stringified ) > 65535 ) {
                        // Sanity check, since the preference can only hold that.
                        return;
                }