Skip to content

Commit 3dc596e

Browse files
committed
MC-1413: (Magento) Dynamic Block Configuration
- Integration tests
1 parent 33a92c1 commit 3dc596e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function removeScriptTags(string $content): string
4444
try {
4545
//this code is required because of https://bugs.php.net/bug.php?id=60021
4646
$previous = libxml_use_internal_errors(true);
47-
$dom->loadHTML($content);
47+
$dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
4848
} catch (\Exception $e) {
4949
$this->loggerInterface->critical($e->getMessage());
5050
}

dev/tests/integration/testsuite/Magento/PageBuilder/Model/Stage/Renderer/CmsStaticBlockTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CmsStaticBlockTest extends \PHPUnit\Framework\TestCase
1212
/**
1313
* @magentoDataFixture Magento/PageBuilder/_files/block_with_script.php
1414
* @magentoDataFixture Magento/Variable/_files/variable.php
15-
* @magentoAppArea adminhtml
15+
* @magentoAppArea frontend
1616
*/
1717
public function testRender()
1818
{
@@ -33,5 +33,7 @@ public function testRender()
3333
$content = $result['content'];
3434
$this->assertNotContains('<script>', $content);
3535
$this->assertContains('<p>Custom variable: "HTML Value".</p>', $content);
36+
$this->assertNotContains('<html>', $content);
37+
$this->assertNotContains('<!DOCTYPE', $content);
3638
}
3739
}

0 commit comments

Comments
 (0)