Skip to content

Commit 5f885cc

Browse files
committed
Merge remote-tracking branch 'adobe-commerce-tier-4/ACP2E-3043' into Tier4-Kings-PR-01-20-2025
2 parents 2d62730 + 6722dc3 commit 5f885cc

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
use Magento\Customer\ViewModel\Customer\Data;
7-
use Magento\Framework\App\ObjectManager;
87
use Magento\Customer\ViewModel\CookieSettings;
98

10-
/** @var \Magento\Customer\Block\CustomerData $block */
9+
/**
10+
* @var \Magento\Customer\Block\CustomerData $block
11+
* @var \Magento\Framework\Escaper $escaper
12+
*/
1113

1214
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper
1315
/** @var Auth $auth */
14-
$auth = $block->getAuth() ?? ObjectManager::getInstance()->get(Auth::class);
16+
$auth = $block->getAuth();
1517
/** @var JsonSerializer $jsonSerializer */
16-
$jsonSerializer = $block->getJsonSerializer() ??
17-
ObjectManager::getInstance()->get(JsonSerializer::class);
18+
$jsonSerializer = $block->getJsonSerializer();
1819
$customerDataUrl = $block->getCustomerDataUrl('customer/account/updateSession');
1920
$expirableSectionNames = $block->getExpirableSectionNames();
2021
/** @var CookieSettings $cookieSettings */
@@ -24,14 +25,14 @@ $cookieSettings = $block->getCookieSettings();
2425
{
2526
"*": {
2627
"Magento_Customer/js/customer-data": {
27-
"sectionLoadUrl": "<?= $block->escapeJs($block->getCustomerDataUrl('customer/section/load')) ?>",
28+
"sectionLoadUrl": "<?= $escaper->escapeJs($block->getCustomerDataUrl('customer/section/load')) ?>",
2829
"expirableSectionLifetime": <?= (int)$block->getExpirableSectionLifetime() ?>,
2930
"expirableSectionNames": <?= /* @noEscape */ $jsonSerializer->serialize(
3031
$expirableSectionNames
3132
) ?>,
32-
"cookieLifeTime": "<?= $block->escapeJs($block->getCookieLifeTime()) ?>",
33-
"cookieDomain": "<?= $block->escapeJs($cookieSettings->getCookieDomain()) ?>",
34-
"updateSessionUrl": "<?= $block->escapeJs($customerDataUrl) ?>",
33+
"cookieLifeTime": "<?= $escaper->escapeJs($block->getCookieLifeTime()) ?>",
34+
"cookieDomain": "<?= $escaper->escapeJs($cookieSettings->getCookieDomain()) ?>",
35+
"updateSessionUrl": "<?= $escaper->escapeJs($customerDataUrl) ?>",
3536
"isLoggedIn": "<?= /* @noEscape */ $auth->isLoggedIn() ?>"
3637
}
3738
}

0 commit comments

Comments
 (0)