Require raw HTML from Hermes MCP

This commit is contained in:
gitea_admin committed 2026-09-21 15:50:19 +02:00
1 parent dd019afff6
commit 17e07d525b
3 files changed
+8 -10

No files matched your search

-9
View File
@@ -64,15 +64,6 @@ function market_management_sanitize_multiline_html(?string $value): ?string
return $value;
}
for ($decodePass = 0; $decodePass < 3; $decodePass++) {
$decoded = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8');
if ($decoded === $value) {
break;
}
$value = $decoded;
}
$value = preg_replace('/(<a\b[^>]*\bhref\s*=\s*["\'])@url:/iu', '$1', $value) ?? $value;
$tokens = preg_split('/(<\/?a\b[^>]*>|<br\s*\/?>|<\/?strong\s*>)/iu', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
if ($tokens === false) {
return htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');