feat: ship creator journey v2 and profile updates
This commit is contained in:
@@ -206,12 +206,18 @@ class ContentSanitizer
|
||||
*/
|
||||
private static function sanitizeHtml(string $html, bool $allowLinks = true): string
|
||||
{
|
||||
$encodedHtml = mb_encode_numericentity(
|
||||
$html,
|
||||
[0x80, 0x10FFFF, 0, 0xFFFFFF],
|
||||
'UTF-8'
|
||||
);
|
||||
|
||||
// Parse with DOMDocument
|
||||
$doc = new \DOMDocument('1.0', 'UTF-8');
|
||||
// Suppress warnings from malformed fragments
|
||||
libxml_use_internal_errors(true);
|
||||
$doc->loadHTML(
|
||||
'<?xml encoding="UTF-8"><html><body>' . $html . '</body></html>',
|
||||
'<?xml encoding="UTF-8"><html><body>' . $encodedHtml . '</body></html>',
|
||||
LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD
|
||||
);
|
||||
libxml_clear_errors();
|
||||
@@ -226,7 +232,7 @@ class ContentSanitizer
|
||||
}
|
||||
|
||||
// Fix self-closing <a></a> etc.
|
||||
return trim($inner);
|
||||
return trim(html_entity_decode($inner, ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user