Skip to content

Commit fed3996

Browse files
committed
MC-15970: Page Builder Dynamic Block
1 parent 2a8b3d2 commit fed3996

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/PageBuilder/Model/Stage/HtmlFilter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ public function filterHtml(string $content): string
5252
// Remove all <script /> tags, on* attributes from output
5353
/** @var \DOMElement $item */
5454
foreach (iterator_to_array($dom->getElementsByTagName('*')) as $item) {
55-
if ($item->tagName === 'script') {
55+
if (in_array($item->tagName, ['script', 'meta', 'iframe', 'embed', 'object'])) {
5656
$item->parentNode->removeChild($item);
5757
} else {
5858
foreach (iterator_to_array($item->attributes) as $attribute) {
59-
if (stripos($attribute->name, 'on') === 0) {
59+
if (stripos($attribute->name, 'on') === 0 ||
60+
stripos(ltrim($attribute->value), 'javascript') === 0
61+
) {
6062
$item->removeAttribute($attribute->name);
6163
}
6264
}

0 commit comments

Comments
 (0)