← All changes
|
core/module/stripe-addon/handler/stripe_handler.php
+3
-3
1.0.13
→
1.0.27
View file →
| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | * |
| 43 | 43 | * @return \WP_REST_Response The response object |
| 44 | 44 | */ |
| 45 | 45 | public static function handle_callback( $request ) { |
| 46 | - if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), 'booktics_stripe_callback' ) ) { | |
| 46 | + if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'booktics_stripe_callback' ) ) { | |
| 47 | 47 | return rest_ensure_response( [ |
| 48 | 48 | 'status' => 'error', |
| 49 | 49 | 'message' => __( 'Invalid security token', 'booktics' ) |
| 50 | 50 | ] ); |
| @@ -63,9 +63,9 @@ | ||
| 63 | 63 | if ( ! empty( $account_id ) ) { |
| 64 | 64 | Settings::update( 'stripe_account_id', $account_id ); |
| 65 | 65 | Settings::update( 'stripe_account_type', $type ); |
| 66 | 66 | |
| 67 | - wp_redirect( admin_url( 'admin.php?page=booktics#/settings?tab=payment' ) ); | |
| 67 | + wp_safe_redirect( admin_url( 'admin.php?page=booktics#/settings?tab=payment' ) ); | |
| 68 | 68 | exit; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return rest_ensure_response( [ |
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | * |
| 80 | 80 | * @return string The authorization URL |
| 81 | 81 | */ |
| 82 | 82 | public function get_connect_url( $type = 'test' ) { |
| 83 | - return STRIPE_CONNECT_DOMAIN . '/stripe/connect?type=' . $type . '&redirect_uri=' . base64_encode( $this->get_redirect_uri( $type ) ); | |
| 83 | + return BOOKTICS_STRIPE_CONNECT_DOMAIN . '/stripe/connect?type=' . $type . '&redirect_uri=' . base64_encode( $this->get_redirect_uri( $type ) ); | |
| 84 | 84 | } |
| 85 | 85 | } |