build: Enable and make pass no-prototype-builtins
[lhc/web/wiklou.git] / resources / src / mediawiki.Title / Title.js
index dcaae3e..c02af98 100644 (file)
                rWhitespace = /[ _\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+/g,
 
                // From MediaWikiTitleCodec::splitTitleString() in PHP
-               rStripCharacters = /[\u00AD\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,
+               rUnicodeBidi = /[\u200E\u200F\u202A-\u202E]/g,
 
                /**
                 * Slightly modified from Flinfo. Credit goes to Lupo and Flominator.
                        namespace = defaultNamespace === undefined ? NS_MAIN : defaultNamespace;
 
                        title = title
-                               // Strip soft hyphens and Unicode directional formatting characters
-                               .replace( rStripCharacters, '' )
+                               // Strip Unicode bidi override characters
+                               .replace( rUnicodeBidi, '' )
                                // Normalise whitespace to underscores and remove duplicates
                                .replace( rWhitespace, '_' )
                                // Trim underscores
                                tiff: 'tif',
                                ogv: 'ogg'
                        };
-               if ( squish.hasOwnProperty( lower ) ) {
+               if ( Object.prototype.hasOwnProperty.call( squish, lower ) ) {
                        return squish[ lower ];
                } else if ( /^[0-9a-z]+$/.test( lower ) ) {
                        return lower;