mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-21 03:03:25 -05:00
fix: use replaceAll instead of replace
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ export const stripInlineStyles = (html: string): string => {
|
||||
// `style-src` violations at parse time — before FORBID_ATTR can strip them.
|
||||
// The regex is O(n) safe: [^"]* and [^']* are negated classes bounded by
|
||||
// fixed quote delimiters, so no backtracking can occur.
|
||||
const preStripped = html.replace(/ style="[^"]*"| style='[^']*'/gi, "");
|
||||
const preStripped = html.replaceAll(/ style="[^"]*"| style='[^']*'/gi, "");
|
||||
|
||||
return DOMPurify.sanitize(preStripped, {
|
||||
FORBID_ATTR: ["style"],
|
||||
|
||||
@@ -15,7 +15,7 @@ export const stripInlineStyles = (html: string): string => {
|
||||
// `style-src` violations at parse time — before FORBID_ATTR can strip them.
|
||||
// The regex is O(n) safe: [^"]* and [^']* are negated classes bounded by
|
||||
// fixed quote delimiters, so no backtracking can occur.
|
||||
const preStripped = html.replace(/ style="[^"]*"| style='[^']*'/gi, "");
|
||||
const preStripped = html.replaceAll(/ style="[^"]*"| style='[^']*'/gi, "");
|
||||
|
||||
return DOMPurify.sanitize(preStripped, {
|
||||
FORBID_ATTR: ["style"],
|
||||
|
||||
Reference in New Issue
Block a user