Skip to content

Commit 23022c4

Browse files
committed
AC-7422:Incompatible issues fix for PHP8.2
1 parent 5fcfe89 commit 23022c4

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

app/code/Magento/Sales/Helper/Admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ public function escapeHtmlWithLinks($data, $allowedTags = null)
165165
$domDocument = $this->domDocumentFactory->create();
166166

167167
$internalErrors = libxml_use_internal_errors(true);
168-
169-
$data = html_entity_decode(htmlentities($data, ENT_QUOTES, 'UTF-8'), ENT_QUOTES , 'ISO-8859-1');
168+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
169+
$data = html_entity_decode(htmlentities($data, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'ISO-8859-1');
170170

171171
$domDocument->loadHTML(
172172
'<html><body id="' . $wrapperElementId . '">' . $data . '</body></html>'

dev/tests/integration/testsuite/Magento/Sales/Helper/AdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function escapeHtmlWithLinksDataProvider(): array
5555
[
5656
// @codingStandardsIgnoreStart
5757
'Authorized amount of €30.00. Transaction ID: "<a target="_blank" href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=123456789QWERTY">123456789QWERTY</a>"',
58-
'Authorized amount of 30.00. Transaction ID: &quot;<a href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&amp;id=123456789QWERTY">123456789QWERTY</a>&quot;',
58+
'Authorized amount of &euro;30.00. Transaction ID: &quot;<a href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&amp;id=123456789QWERTY">123456789QWERTY</a>&quot;',
5959
// @codingStandardsIgnoreEnd
6060
'allowedTags' => ['b', 'br', 'strong', 'i', 'u', 'a'],
6161
],

dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Magento\TestFramework\Helper\Bootstrap;
2222
use Magento\TestFramework\ObjectManager;
2323
use PHPUnit\Framework\MockObject\MockObject;
24+
use Symfony\Component\HttpFoundation\Response;
2425

2526
/**
2627
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -142,6 +143,7 @@ public function testInitFromOrderAndCreateOrderFromQuoteWithAdditionalOptions()
142143
['additional_option_key' => 'additional_option_value'],
143144
$newOrderItem->getProductOptionByCode('additional_options')
144145
);
146+
Response::closeOutputBuffers(1, false);
145147
}
146148

147149
/**

lib/internal/Magento/Framework/Escaper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Escaper
1717
{
1818
/**
1919
* HTML special characters flag
20+
* @var $htmlSpecialCharsFlag
2021
*/
2122
private $htmlSpecialCharsFlag = ENT_QUOTES | ENT_SUBSTITUTE;
2223

@@ -346,6 +347,7 @@ public function escapeCss($string)
346347
* @param string $quote
347348
* @return string|array
348349
* @deprecated 101.0.0
350+
* @see 6729b6e01368248abc33300208eb292c95050203
349351
*/
350352
public function escapeJsQuote($data, $quote = '\'')
351353
{
@@ -366,6 +368,7 @@ public function escapeJsQuote($data, $quote = '\'')
366368
* @param string $data
367369
* @return string
368370
* @deprecated 101.0.0
371+
* @see 6729b6e01368248abc33300208eb292c95050203
369372
*/
370373
public function escapeXssInUrl($data)
371374
{
@@ -414,6 +417,7 @@ private function escapeScriptIdentifiers(string $data): string
414417
* @param bool $addSlashes
415418
* @return string
416419
* @deprecated 101.0.0
420+
* @see 6729b6e01368248abc33300208eb292c95050203
417421
*/
418422
public function escapeQuote($data, $addSlashes = false)
419423
{
@@ -428,6 +432,7 @@ public function escapeQuote($data, $addSlashes = false)
428432
*
429433
* @return \Magento\Framework\ZendEscaper
430434
* @deprecated 101.0.0
435+
* @see 6729b6e01368248abc33300208eb292c95050203
431436
*/
432437
private function getEscaper()
433438
{
@@ -443,6 +448,7 @@ private function getEscaper()
443448
*
444449
* @return \Psr\Log\LoggerInterface
445450
* @deprecated 101.0.0
451+
* @see 6729b6e01368248abc33300208eb292c95050203
446452
*/
447453
private function getLogger()
448454
{

0 commit comments

Comments
 (0)