Skip to content

Commit 40c184e

Browse files
committed
AC-2088: Fixed shipping policy rendering issue
* Fixed policy rendering issue
1 parent 031fe7e commit 40c184e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/code/Magento/Checkout/Model/DefaultConfigProvider.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use Magento\Quote\Model\QuoteIdMaskFactory;
3232
use Magento\Store\Model\ScopeInterface;
3333
use Magento\Ui\Component\Form\Element\Multiline;
34+
use Magento\Framework\Escaper;
3435

3536
/**
3637
* Default Config Provider for checkout
@@ -191,6 +192,11 @@ class DefaultConfigProvider implements ConfigProviderInterface
191192
*/
192193
private $configPostProcessor;
193194

195+
/**
196+
* @var Escaper
197+
*/
198+
private $escaper;
199+
194200
/**
195201
* @param CheckoutHelper $checkoutHelper
196202
* @param Session $checkoutSession
@@ -222,6 +228,7 @@ class DefaultConfigProvider implements ConfigProviderInterface
222228
* @param AddressMetadataInterface $addressMetadata
223229
* @param AttributeOptionManagementInterface $attributeOptionManager
224230
* @param CustomerAddressDataProvider|null $customerAddressData
231+
* @param Escaper|null $escaper
225232
* @codeCoverageIgnore
226233
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
227234
*/
@@ -255,7 +262,8 @@ public function __construct(
255262
CaptchaConfigPostProcessorInterface $configPostProcessor,
256263
AddressMetadataInterface $addressMetadata = null,
257264
AttributeOptionManagementInterface $attributeOptionManager = null,
258-
CustomerAddressDataProvider $customerAddressData = null
265+
CustomerAddressDataProvider $customerAddressData = null,
266+
Escaper $escaper = null
259267
) {
260268
$this->checkoutHelper = $checkoutHelper;
261269
$this->checkoutSession = $checkoutSession;
@@ -289,6 +297,7 @@ public function __construct(
289297
$this->customerAddressData = $customerAddressData ?:
290298
ObjectManager::getInstance()->get(CustomerAddressDataProvider::class);
291299
$this->configPostProcessor = $configPostProcessor;
300+
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(Escaper::class);
292301
}
293302

294303
/**
@@ -343,6 +352,7 @@ public function getConfig()
343352
'shipping/shipping_policy/shipping_policy_content',
344353
ScopeInterface::SCOPE_STORE
345354
);
355+
$policyContent = $this->escaper->escapeHtml($policyContent);
346356
$output['shippingPolicy'] = [
347357
'isEnabled' => $this->scopeConfig->isSetFlag(
348358
'shipping/shipping_policy/enable_shipping_policy',

0 commit comments

Comments
 (0)