Skip to content

Commit 510606f

Browse files
committed
MC-3678: Master format containing HTML5 elements is broken when used in block
1 parent b96e49e commit 510606f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/code/Magento/PageBuilder/Model/Stage/Renderer/CmsStaticBlock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ private function removeScriptTags(array $directiveResult): array
106106
{
107107
$dom = new \DOMDocument();
108108
try {
109+
//this code is required because of https://bugs.php.net/bug.php?id=60021
110+
$previous = libxml_use_internal_errors(true);
109111
$dom->loadHTML($directiveResult['content']);
110112
} catch (\Exception $e) {
111113
$this->loggerInterface->critical($e->getMessage());
112-
return [
113-
'error' => __('The block cannot be displayed because it contains errors.')
114-
];
115114
}
115+
libxml_use_internal_errors($previous);
116116
foreach (iterator_to_array($dom->getElementsByTagName('script')) as $item) {
117117
$item->parentNode->removeChild($item);
118118
}

0 commit comments

Comments
 (0)