Skip to content

Commit

Permalink
Resolve PCP security warnings in `AspireUpdate\Admin_Settings::update…
Browse files Browse the repository at this point in the history
…_settings()`. (#134)
  • Loading branch information
costdev authored Nov 5, 2024
1 parent 2b15a47 commit 1529cfb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ public function update_settings() {
}

// Save settings and redirect.
if ( ( isset( $_POST['option_page'] ) && 'aspireupdate_settings' === $_POST['option_page'] ) ) {
update_site_option( $this->option_name, $this->sanitize_settings( wp_unslash( $_POST['aspireupdate_settings'] ) ) );
if ( ( isset( $_POST['option_page'], $_POST['aspireupdate_settings'] ) && 'aspireupdate_settings' === $_POST['option_page'] ) ) {
update_site_option(
$this->option_name,
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Contents are sanitized in Admin_Settings::sanitize_settings.
$this->sanitize_settings( wp_unslash( $_POST['aspireupdate_settings'] ) )
);

wp_safe_redirect(
add_query_arg( [ network_admin_url( 'index.php?page=aspireupdate-settings' ) ] )
Expand Down

0 comments on commit 1529cfb

Please sign in to comment.