Skip to content

Commit 1b3403e

Browse files
committed
Fixed unexpected end of file error in phtml files on PHP7.2 or lower
1 parent 5307a6c commit 1b3403e

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

view/adminhtml/templates/system/config/button/export-container-button.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ if (!isset($escaper)) {
3232
window.location='{$escaper->escapeUrl($block->getContainerGenerateUrl())}';
3333
});
3434
});
35-
script; ?>
35+
script;
36+
?>
3637
<?= /* @noEscape */ $mfSecureRenderer->renderTag('script', [], $script, false) ?>
3738
</div>
3839

view/frontend/templates/js_code.phtml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ $script = '';
3131
window.mfGtmUserActionDetected = true;
3232
mfLoadGtm();
3333
}
34-
script; ?>
34+
script;
35+
?>
3536
<?php } else { ?>
3637
<?php $script .= <<<script
3738
window.mfGtmUserActionDetected = true;
38-
script; ?>
39+
script;
40+
?>
3941
<?php } ?>
4042

4143
<?php if ($block->isProtectCustomerDataEnabled()) { ?>
@@ -60,13 +62,15 @@ $script = '';
6062
gtag("set", "ads_data_redaction", true);
6163
gtag("set", "url_passthrough", true);
6264
/* cookieyes.com end */
63-
script; ?>
65+
script;
66+
?>
6467

6568
<?php if ($block->isLoadBeforeConsent()) { ?>
6669
<?php $script .= <<<script
6770
window.mfGtmLoadBeforeCookieAllowed = true;
6871
mfLoadGtm();
69-
script; ?>
72+
script;
73+
?>
7074
<?php } ?>
7175

7276
<?php if ($block->isCookieRestrictionModeEnabled()) { ?>
@@ -130,14 +134,16 @@ $script = '';
130134
}, 1000);
131135
}
132136
})();
133-
script; ?>
137+
script;
138+
?>
134139
<?php } ?>
135140

136141
<?php } else { ?>
137142
<?php $script .= <<<script
138143
window.mfGtmUserCookiesAllowed = true;
139144
mfLoadGtm();
140-
script; ?>
145+
script;
146+
?>
141147
<?php } ?>
142148
<?php $script .= <<<script
143149
@@ -151,7 +157,8 @@ $script = '';
151157
152158
if (window.mfGTMTriedToLoad) return;
153159
window.mfGTMTriedToLoad = true;
154-
script; ?>
160+
script;
161+
?>
155162
<?php if ($block->getPublicId()) { ?>
156163
<?php if ('use_public_id' === $block->getConfig()->getInstallGtm()) { ?>
157164
<?php $script .= <<<script
@@ -160,14 +167,16 @@ $script = '';
160167
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
161168
'https:' + '/' + '/' + 'www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
162169
})(window,document,'script','dataLayer','{$escaper->escapeHtml($block->getPublicId())}');
163-
script; ?>
170+
script;
171+
?>
164172
<?php } elseif ('use_head_and_body_script' === $block->getConfig()->getInstallGtm()) { ?>
165173
<?php $script .= $block->getGtmScript(); ?>
166174
<?php } ?>
167175
<?php } ?>
168176
<?php $script .= <<<script
169177
}
170-
script; ?>
178+
script;
179+
?>
171180
<?= /* @noEscape */ $mfSecureRenderer->renderTag('script', [], $script, false) ?>
172181

173182
<?php if (!$mfHyvaThemeDetection->execute()) { ?>
@@ -186,7 +195,8 @@ $script = '';
186195
}.bind(this));
187196
updateMfGtmCustomerIdentifier(customerData());
188197
});
189-
script; ?>
198+
script;
199+
?>
190200
<?= /* @noEscape */ $mfSecureRenderer->renderTag('script', [], $script, false) ?>
191201
<?php } else { ?>
192202
<?php $script = <<<script
@@ -204,7 +214,8 @@ $script = '';
204214
}
205215
window.addEventListener("private-content-loaded", mfHyvaGtmSetCustomerIdentifier);
206216
/* End Hyva code */
207-
script; ?>
217+
script;
218+
?>
208219
<?= /* @noEscape */ $mfSecureRenderer->renderTag('script', [], $script, false) ?>
209220
<?php } ?>
210221
<!-- End Google Tag Manager -->

0 commit comments

Comments
 (0)