File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
app/code/Magento/PageBuilder/Model/Filter Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ private function getMediaQuery(string $view) : ?string
361
361
}
362
362
363
363
/**
364
- * Masks script tags in html content before loading it into DOM parser
364
+ * Masks "x-magento-template" script tags in html content before loading it into DOM parser
365
365
*
366
366
* DOMDocument::loadHTML() will remove any closing tag inside script tag and will result in broken html template
367
367
*
@@ -373,7 +373,7 @@ private function maskScriptTags(string $content): string
373
373
{
374
374
$ tag = 'script ' ;
375
375
$ content = preg_replace_callback (
376
- " #< { $ tag } [^>]+?> .*?</ { $ tag } >#is " ,
376
+ sprintf ( ' #<%1$s [^>]*type="text/x-magento-template\"[^>]*> .*?</%1$s >#is' , $ tag ) ,
377
377
function ($ matches ) {
378
378
$ key = $ this ->mathRandom ->getRandomString (32 , $ this ->mathRandom ::CHARS_LOWERS );
379
379
$ this ->scripts [$ key ] = $ matches [0 ];
@@ -385,7 +385,7 @@ function ($matches) {
385
385
}
386
386
387
387
/**
388
- * Replaces masked script tags with their corresponding content
388
+ * Replaces masked "x-magento-template" script tags with their corresponding content
389
389
*
390
390
* @param string $content
391
391
* @return string
You can’t perform that action at this time.
0 commit comments