Open gem85247 opened 1 year ago
I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting [ ] feature request
Current behavior
When passing the following through the "stripTags" pipe the browser crashes because of a regex recursive loop. Here is the breaking input:
• Damas Syrian (100 metres) < 1-minute walk • Brazza cocktailbar (160 metres) < 2-minute walk • Spanish Inn - Live Music Pub (400 metres) < 5-minute walk • Bistro Mathilda (450 metres) < 5-minute walk
Expected behavior
Should return requested output without bricking the browser.
Minimal reproduction of the problem with instructions
STEPS TO REPRODUCE
Pass the breaking inpu (see above) and watch the browser/javascript engine crash/freeze.
MINIMAL DEMO
Just grabbed the regex from the source code and you can test the following snippet in any browser console:
console.log(`• Damas Syrian (100 metres) < 1-minute walk • Brazza cocktailbar (160 metres) < 2-minute walk • Spanish Inn - Live Music Pub (400 metres) < 5-minute walk • Bistro Mathilda (450 metres) < 5-minute walk`.replace(/<(?:.|\s)*?>/g, ''));
Please tell us about your environment:
MacOs, WebStorm IDE, npm
Angular version: 15.2.9
Node (for AoT issues): node --version =
node --version
The following Regex seems to fix the issue: /(<([^>]+)>)/gi. But I'm not a regex expert by any means 🙃
/(<([^>]+)>)/gi
I'm submitting a ... (check one with "x")
Current behavior
When passing the following through the "stripTags" pipe the browser crashes because of a regex recursive loop. Here is the breaking input:
Expected behavior
Should return requested output without bricking the browser.
Minimal reproduction of the problem with instructions
STEPS TO REPRODUCE
Pass the breaking inpu (see above) and watch the browser/javascript engine crash/freeze.
MINIMAL DEMO
Just grabbed the regex from the source code and you can test the following snippet in any browser console:
Please tell us about your environment:
MacOs, WebStorm IDE, npm
Angular version: 15.2.9
Node (for AoT issues):
node --version
=