Skip to content

Commit

Permalink
Use sanitize_text_field with wp_unslash
Browse files Browse the repository at this point in the history
  • Loading branch information
htdat committed Aug 26, 2023
1 parent 13e49c3 commit 61fef48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Internal/Payment/PaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct( array $request = null ) {
*/
public function get_fraud_prevention_token(): ?string {
return isset( $this->request['wcpay-fraud-prevention-token'] )
? sanitize_text_field( $this->request['wcpay-fraud-prevention-token'] )
? sanitize_text_field( wp_unslash( ( $this->request['wcpay-fraud-prevention-token'] ) ) )
: null;
}

Expand All @@ -55,7 +55,7 @@ public function is_woopay_preflight_check(): bool {
*/
public function get_woopay_intent_id(): ?string {
return isset( $this->request['platform-checkout-intent'] )
? sanitize_text_field( $this->request['platform-checkout-intent'] )
? sanitize_text_field( wp_unslash( ( $this->request['platform-checkout-intent'] ) ) )
: null;
}

Expand All @@ -75,7 +75,7 @@ public function get_order_id(): ?int {
*/
public function get_intent_id(): ?string {
return isset( $this->request['intent_id'] )
? sanitize_text_field( $this->request['intent_id'] )
? sanitize_text_field( wp_unslash( ( $this->request['intent_id'] ) ) )
: null;
}

Expand All @@ -86,7 +86,7 @@ public function get_intent_id(): ?string {
*/
public function get_payment_method_id(): ?string {
return isset( $this->request['payment_method_id'] )
? sanitize_text_field( $this->request['payment_method_id'] )
? sanitize_text_field( wp_unslash( ( $this->request['payment_method_id'] ) ) )
: null;
}
}

0 comments on commit 61fef48

Please sign in to comment.