Skip to content

Commit

Permalink
Find and replace script tags only (#2082)
Browse files Browse the repository at this point in the history
* Find and replace script tags only

* Fix regex
  • Loading branch information
vidya-ram authored Jun 26, 2024
1 parent 5782312 commit e291a5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion funnel/assets/js/membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ const Membership = {
const data = await response.json();
if (data) {
const vueFormHtml = data.form;
this.memberForm = vueFormHtml.replace(/\bscript\b/g, 'script2');
this.memberForm = vueFormHtml.replace(/<\/?\bscript/gi, (tag) =>
tag === '<script' ? '<script2' : '</script2',
);
this.errorMsg = '';
$('#member-form').modal('show');
}
Expand Down

0 comments on commit e291a5f

Please sign in to comment.