freescout-gpt-assistant/utils
Zack Katz 4b73325b06
Update utils/htmlSanitizer.js
forEach loop doesn't properly handle regex flag state

The DANGEROUS_PATTERNS array contains regex patterns with the global flag (/gi). When used in a forEach loop, these regexes maintain state between matches which could cause unexpected behavior.

Reset the regex state or avoid the global flag when using test()

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-22 13:44:07 -04:00
..
htmlSanitizer.js Update utils/htmlSanitizer.js 2025-09-22 13:44:07 -04:00