fix(vip): preserve safe HTML in VIP copy
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7a0445fc4a
commit
573040381d
15 files changed
+155
-118
No files matched your search
@@ -481,7 +481,7 @@ endif;
|
||||
* or Chinese keyword heuristics — that mangles intentional HTML.
|
||||
*
|
||||
* Rules:
|
||||
* - Sanitize with a small allowlist.
|
||||
* - Sanitize with WordPress post-safe HTML.
|
||||
* - If markup already has <li>, wrap the items in <ul class="v-equity …">.
|
||||
* - Otherwise output the sanitized HTML inside <div class="v-equity …">.
|
||||
* - Plain multi-line text: each non-empty line becomes one <li> (only \n split).
|
||||
@@ -497,21 +497,7 @@ if (!function_exists('aksrt_format_vip_equity_html')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$allowed = [
|
||||
'li' => ['class' => true],
|
||||
'ul' => ['class' => true],
|
||||
'ol' => ['class' => true],
|
||||
'strong' => [],
|
||||
'b' => [],
|
||||
'em' => [],
|
||||
'i' => ['class' => true],
|
||||
'span' => ['class' => true],
|
||||
'br' => [],
|
||||
'p' => ['class' => true],
|
||||
'div' => ['class' => true],
|
||||
'a' => ['href' => true, 'target' => true, 'rel' => true, 'class' => true],
|
||||
];
|
||||
$clean = trim(wp_kses($raw, $allowed));
|
||||
$clean = trim(wp_kses_post($raw));
|
||||
if ($clean === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user