We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57de58d commit a448ee5Copy full SHA for a448ee5
app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php
@@ -20,8 +20,7 @@ public function beforeSendResponse(\Magento\Framework\App\Response\Http $subject
20
{
21
$content = $subject->getContent();
22
$script = [];
23
- if (strpos($content, '</body') > 0) {
24
- $content = preg_replace('#<!--(?!\s?/?ko).*?-->#s', '', $content);
+ if (strpos($content, '</body') !== false) {
25
$pattern = '#<script[^>]*+(?<!text/x-magento-template.)>.*?</script>#is';
26
$content = preg_replace_callback(
27
$pattern,
@@ -36,4 +35,4 @@ function ($matchPart) use (&$script) {
36
35
);
37
}
38
39
-}
+}
0 commit comments