Skip to content

Commit da3fa89

Browse files
committed
AC-7422::Incompatible issues fix for PHP8.2
1 parent e35ff85 commit da3fa89

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function escapeHtmlWithLinks($data, $allowedTags = null)
166166

167167
$internalErrors = libxml_use_internal_errors(true);
168168

169-
$data = html_entity_decode($data, ENT_QUOTES, 'UTF-8');
169+
$data = htmlentities($data, ENT_QUOTES | ENT_IGNORE, 'UTF-8', false);
170170
$domDocument->loadHTML(
171171
'<html><body id="' . $wrapperElementId . '">' . $data . '</body></html>'
172172
);
@@ -192,7 +192,7 @@ public function escapeHtmlWithLinks($data, $allowedTags = null)
192192
}
193193
}
194194

195-
$result = mb_convert_encoding($domDocument->saveHTML(), 'UTF-8', 'HTML-ENTITIES');
195+
$result = htmlspecialchars_decode($domDocument->saveHTML(), ENT_QUOTES);
196196
preg_match('/<body id="' . $wrapperElementId . '">(.+)<\/body><\/html>$/si', $result, $matches);
197197
$data = !empty($matches) ? $matches[1] : '';
198198
}

lib/internal/Magento/Framework/Escaper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function ($errorNumber, $errorString) {
113113
$this->escapeText($domDocument);
114114
$this->escapeAttributeValues($domDocument);
115115

116-
$result = mb_convert_encoding($domDocument->saveHTML(), 'UTF-8', 'HTML-ENTITIES');
116+
$result = html_entity_decode($domDocument->saveHTML(), ENT_QUOTES, 'UTF-8');
117117
preg_match('/<body id="' . $wrapperElementId . '">(.+)<\/body><\/html>$/si', $result, $matches);
118118
return !empty($matches) ? $matches[1] : '';
119119
} else {
@@ -346,6 +346,7 @@ public function escapeCss($string)
346346
* @param string $quote
347347
* @return string|array
348348
* @deprecated 101.0.0
349+
* @see 6729b6e01368248abc33300208eb292c95050203
349350
*/
350351
public function escapeJsQuote($data, $quote = '\'')
351352
{
@@ -366,6 +367,7 @@ public function escapeJsQuote($data, $quote = '\'')
366367
* @param string $data
367368
* @return string
368369
* @deprecated 101.0.0
370+
* @see 6729b6e01368248abc33300208eb292c95050203
369371
*/
370372
public function escapeXssInUrl($data)
371373
{
@@ -414,6 +416,7 @@ private function escapeScriptIdentifiers(string $data): string
414416
* @param bool $addSlashes
415417
* @return string
416418
* @deprecated 101.0.0
419+
* @see 6729b6e01368248abc33300208eb292c95050203
417420
*/
418421
public function escapeQuote($data, $addSlashes = false)
419422
{
@@ -428,6 +431,7 @@ public function escapeQuote($data, $addSlashes = false)
428431
*
429432
* @return \Magento\Framework\ZendEscaper
430433
* @deprecated 101.0.0
434+
* @see 6729b6e01368248abc33300208eb292c95050203
431435
*/
432436
private function getEscaper()
433437
{
@@ -443,6 +447,7 @@ private function getEscaper()
443447
*
444448
* @return \Psr\Log\LoggerInterface
445449
* @deprecated 101.0.0
450+
* @see 6729b6e01368248abc33300208eb292c95050203
446451
*/
447452
private function getLogger()
448453
{

0 commit comments

Comments
 (0)