Switched from uas_parser.js to ua-parser-js library to improve library management and remove ReDos vulnerabilities. Also improved performance of two native regexes. Thanks to James Davis for raising awareness.

This commit is contained in:
n1474335 2018-02-28 16:40:15 +00:00
parent a177e2ab7e
commit da473de9f0
8 changed files with 27 additions and 25839 deletions

View file

@ -207,7 +207,7 @@ const Extract = {
*/
runEmail: function(input, args) {
let displayTotal = args[0],
regex = /\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}/ig;
regex = /\b\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}\b/ig;
return Extract._search(input, regex, null, displayTotal);
},