diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index 18912286352..4b1a2798049 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -190,8 +190,8 @@ class WC_Admin_Setup_Wizard { 'i18n' => array( 'extra_plugins' => array( 'payment' => array( - 'stripe_create_account' => __( 'Stripe setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ), - 'ppec_paypal_reroute_requests' => __( 'PayPal setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ), + 'stripe_create_account' => __( 'Stripe setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ), + 'ppec_paypal_reroute_requests' => __( 'PayPal setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ), 'stripe_create_account,ppec_paypal_reroute_requests' => __( 'Stripe and PayPal setup are powered by Jetpack and WooCommerce Services.', 'woocommerce' ), ), ), @@ -536,22 +536,16 @@ class WC_Admin_Setup_Wizard { public function wc_setup_store_setup_save() { check_admin_referer( 'wc-setup' ); - // phpcs:disable WordPress.VIP.SuperGlobalInputUsage.AccessDetected, WordPress.VIP.ValidatedSanitizedInput.InputNotValidated, WordPress.VIP.ValidatedSanitizedInput.MissingUnslash - $address = sanitize_text_field( $_POST['store_address'] ); - $address_2 = sanitize_text_field( $_POST['store_address_2'] ); - $city = sanitize_text_field( $_POST['store_city'] ); - $country = sanitize_text_field( $_POST['store_country'] ); - $state = isset( $_POST['store_state'] ) ? sanitize_text_field( $_POST['store_state'] ) : false; - $postcode = sanitize_text_field( $_POST['store_postcode'] ); - $currency_code = sanitize_text_field( $_POST['currency_code'] ); - $product_type = sanitize_text_field( $_POST['product_type'] ); - $sell_in_person = isset( $_POST['sell_in_person'] ) && ( 'yes' === sanitize_text_field( $_POST['sell_in_person'] ) ); - $tracking = isset( $_POST['wc_tracker_checkbox'] ) && ( 'yes' === sanitize_text_field( $_POST['wc_tracker_checkbox'] ) ); - // phpcs:enable - - if ( ! $state ) { - $state = '*'; - } + $address = isset( $_POST['store_address'] ) ? wc_clean( wp_unslash( $_POST['store_address'] ) ) : ''; + $address_2 = isset( $_POST['store_address_2'] ) ? wc_clean( wp_unslash( $_POST['store_address_2'] ) ) : ''; + $city = isset( $_POST['store_city'] ) ? wc_clean( wp_unslash( $_POST['store_city'] ) ) : ''; + $country = isset( $_POST['store_country'] ) ? wc_clean( wp_unslash( $_POST['store_country'] ) ) : ''; + $state = isset( $_POST['store_state'] ) ? wc_clean( wp_unslash( $_POST['store_state'] ) ) : '*'; + $postcode = isset( $_POST['store_postcode'] ) ? wc_clean( wp_unslash( $_POST['store_postcode'] ) ) : ''; + $currency_code = isset( $_POST['currency_code'] ) ? wc_clean( wp_unslash( $_POST['currency_code'] ) ) : ''; + $product_type = isset( $_POST['product_type'] ) ? wc_clean( wp_unslash( $_POST['product_type'] ) ) : ''; + $sell_in_person = isset( $_POST['sell_in_person'] ) && ( 'yes' === wc_clean( wp_unslash( $_POST['sell_in_person'] ) ) ); + $tracking = isset( $_POST['wc_tracker_checkbox'] ) && ( 'yes' === wc_clean( wp_unslash( $_POST['wc_tracker_checkbox'] ) ) ); update_option( 'woocommerce_store_address', $address ); update_option( 'woocommerce_store_address_2', $address_2 ); @@ -790,8 +784,8 @@ class WC_Admin_Setup_Wizard { * @param string $input_prefix Input prefix. */ protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) { - $selected = 'flat_rate'; - $shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code ); + $selected = 'flat_rate'; + $shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code ); ?>
@@ -966,7 +960,7 @@ class WC_Admin_Setup_Wizard { 'class' => array(), 'data-tip' => array(), ), - 'a' => array( + 'a' => array( 'href' => array(), 'target' => array(), ), @@ -985,28 +979,32 @@ class WC_Admin_Setup_Wizard {