Created by: nikonthethird
Recently, the method used to check attributes in the sanitizer has been switched from match
to test
.
The test
method on regexes however behaves different than the match
method on strings in the presence of the global modifier (g).
See here for an example where the same input returns true, then false.
This modifier causes issues when the same template is sanitized multiple times, which happens when hovering over tooltips containing an <img src>
tag for example.
This PR also adds a unit test for sanitizing the same template twice.
This fixes #33124 (closed).