Skip to content

Commit 6f437ea

Browse files
committed
Fix multiline options in admin saved improperly
These options depend on separating their values with newlines, but sanitize_text_field strips out newlines. Fix by using sanitize_textarea_field instead.
1 parent 3e93233 commit 6f437ea

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Unreleased
22

3+
- Fix multiline options in admin did not save properly.
4+
35
## 9.9.0 (2026-04-02)
46

57
- Fix attempting to send deployment emails when no email address is set.

src/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ public static function saveFromAdmin(
680680
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verification is handled by calling function
681681
if ( isset( $_POST[ $name ] ) ) {
682682
// phpcs:ignore WordPress.Security.NonceVerification.Missing
683-
$v = sanitize_text_field( wp_unslash( $_POST[ $name ] ) );
683+
$v = sanitize_textarea_field( wp_unslash( $_POST[ $name ] ) );
684684
} else {
685685
$v = '';
686686
}

0 commit comments

Comments
 (0)