Skip to content

Commit

Permalink
Sanitize input
Browse files Browse the repository at this point in the history
  • Loading branch information
nbloomf authored and annemirasol committed Jan 2, 2025
1 parent 4a02760 commit d9ec55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wc-stripe-intent-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ public function confirm_change_payment_from_setup_intent_ajax() {
throw new WC_Stripe_Exception( 'subscription_not_found', __( "We're not able to process this subscription change payment request payment. Please try again later.", 'woocommerce-gateway-stripe' ) );
}

$setup_intent_id = isset( $_POST['intent_id'] ) ? wc_clean( wp_unslash( $_POST['intent_id'] ) ) : null;
$setup_intent_id = ( isset( $_POST['intent_id'] ) && is_string( $_POST['intent_id'] ) ) ? sanitize_text_field( wp_unslash( $_POST['intent_id'] ) ) : null;

if ( empty( $setup_intent_id ) ) {
throw new WC_Stripe_Exception( 'intent_not_found', __( "We're not able to process this subscription change payment request payment. Please try again later.", 'woocommerce-gateway-stripe' ) );
Expand Down

0 comments on commit d9ec55c

Please sign in to comment.