Skip to content

Commit

Permalink
Fixed issue #16531: Validation regex including unicode characters fai…
Browse files Browse the repository at this point in the history
…ls (#1521)

Decoding html before running regex. This (a decode string) is similar to what the PHP side regex function gets.
  • Loading branch information
gabrieljenik committed Aug 10, 2020
1 parent a380df5 commit b46da27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/packages/expressions/em_javascript.js
Expand Up @@ -850,7 +850,8 @@ function LEMregexMatch(sRegExp,within)
var flags = sRegExp.replace(/.*\/([gimy]*)$/, '$1');
var pattern = sRegExp.replace(new RegExp('^/(.*?)/'+flags+'$'), '$1').trim();
var reg = new RegExp(pattern, flags); // Note that the /u flag crashes IE11
return reg.test(within);
var decodedValue = html_entity_decode(within);
return reg.test(decodedValue);
}
catch (err) {
return false;
Expand Down

0 comments on commit b46da27

Please sign in to comment.