Skip to content

Commit 524108c

Browse files
authored
fix: add type and data-ajax-nonce to button kses allowlist (#879)
The setup wizard requirements table HTML passes through wp_kses() twice (field-note.php and default.php templates). The button element's kses allowlist only permitted disabled, name, and value — stripping type="button" and data-ajax-nonce from the Network Activate button. Without type="button", the click submits the parent form instead of triggering the AJAX handler. Without data-ajax-nonce, the JS reads undefined and the server rejects the request with bad-nonce. PR #875 correctly moved the JS to an external file and changed the nonce field to _ajax_nonce, but the button attributes were still stripped before reaching the browser.
1 parent 44c629d commit 524108c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

inc/functions/helper.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,11 @@ function wu_kses_allowed_html(): array {
491491
'value' => true,
492492
];
493493
$allowed_html['button'] = [
494-
'disabled' => true,
495-
'name' => true,
496-
'value' => true,
494+
'type' => true,
495+
'disabled' => true,
496+
'name' => true,
497+
'value' => true,
498+
'data-ajax-nonce' => true,
497499
];
498500
$allowed_html['dynamic'] = [
499501
':template' => true,

0 commit comments

Comments
 (0)