Fixed incorrect comment closing in sanitize_settings

This commit is contained in:
Ruben Ramirez 2025-04-04 01:26:03 -05:00
parent 4872c78b07
commit e5d0d89f7c

View file

@ -408,11 +408,6 @@ class SettingsPage {
/** /**
* Sanitizes the settings array before saving. * Sanitizes the settings array before saving.
if ( isset( $input['stripe_webhook_secret'] ) ) {
// Basic sanitization, starts with whsec_
$sanitized_input['stripe_webhook_secret'] = sanitize_text_field( $input['stripe_webhook_secret'] );
}
* *
* @param array $input The raw input array from the form. * @param array $input The raw input array from the form.
* @return array The sanitized array. * @return array The sanitized array.
@ -420,6 +415,10 @@ class SettingsPage {
public function sanitize_settings( $input ) { public function sanitize_settings( $input ) {
$sanitized_input = []; $sanitized_input = [];
if ( isset( $input['stripe_webhook_secret'] ) ) {
// Basic sanitization, starts with whsec_
$sanitized_input['stripe_webhook_secret'] = sanitize_text_field( $input['stripe_webhook_secret'] );
}
if ( isset( $input['stripe_public_key'] ) ) { if ( isset( $input['stripe_public_key'] ) ) {
// Basic sanitization, might need stricter validation (e.g., regex for pk_live_/pk_test_) // Basic sanitization, might need stricter validation (e.g., regex for pk_live_/pk_test_)
$sanitized_input['stripe_public_key'] = sanitize_text_field( $input['stripe_public_key'] ); $sanitized_input['stripe_public_key'] = sanitize_text_field( $input['stripe_public_key'] );