Skip to content

Commit 8da6c54

Browse files
rafaelzaleskiKristófer R
andauthored
Ensure proper URL formatting (#2358)
* add new changelog headers * Clean up add_query_arg and remove_query_arg calls * Update changelog * Update readme.txt * Update changelog and readme Co-authored-by: Kristófer R <[email protected]>
1 parent 14cfd32 commit 8da6c54

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** Changelog ***
22

3+
= 6.4.1 - 2022-xx-xx =
4+
* Fix - Ensure proper URL formatting.
5+
36
= 6.4.0 - 2022-05-20 =
47
* Fix - Changed logic for how 'Enabled/Disabled' statuses are shown for payments and payouts capabilities in settings.
58
* Tweak - Updated the minimum supported versions of WordPress and WooCommerce.

includes/admin/class-wc-rest-stripe-locations-controller.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ public function register_routes() {
4949
'permission_callback' => [ $this, 'check_permission' ],
5050
'args' => [
5151
'ending_before' => [
52-
'type' => 'string',
52+
'type' => 'string',
5353
'required' => false,
5454
],
5555
'limit' => [
56-
'type' => 'integer',
56+
'type' => 'integer',
5757
'required' => false,
5858
],
5959
'starting_after' => [
60-
'type' => 'string',
60+
'type' => 'string',
6161
'required' => false,
6262
],
6363
],
@@ -178,9 +178,9 @@ public function get_location( $request ) {
178178
* @param WP_REST_Request $request Full data about the request.
179179
*/
180180
public function get_store_location( $request ) {
181-
$name = get_bloginfo();
181+
$name = get_bloginfo();
182182
$store_address = WC()->countries;
183-
$address = array_filter(
183+
$address = array_filter(
184184
[
185185
'city' => $store_address->get_base_city(),
186186
'country' => $store_address->get_base_country(),
@@ -224,7 +224,7 @@ public function get_store_location( $request ) {
224224
$response = WC_Stripe_API::request(
225225
[
226226
'display_name' => $name,
227-
'address' => $address,
227+
'address' => $address,
228228
],
229229
'terminal/locations'
230230
);

includes/class-wc-stripe-account.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
*/
1111
class WC_Stripe_Account {
1212

13-
const LIVE_ACCOUNT_OPTION = 'wcstripe_account_data_live';
14-
const TEST_ACCOUNT_OPTION = 'wcstripe_account_data_test';
13+
const LIVE_ACCOUNT_OPTION = 'wcstripe_account_data_live';
14+
const TEST_ACCOUNT_OPTION = 'wcstripe_account_data_test';
1515

1616
const STATUS_COMPLETE = 'complete';
1717
const STATUS_NO_ACCOUNT = 'NOACCOUNT';

includes/compat/trait-wc-stripe-subscriptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function process_subscription_payment( $amount, $renewal_order, $retry =
214214
[
215215
'order' => $order_id,
216216
'nonce' => wp_create_nonce( 'wc_stripe_confirm_pi' ),
217-
'redirect_to' => remove_query_arg( [ 'process_early_renewal', 'subscription_id', 'wcs_nonce' ] ),
217+
'redirect_to' => esc_url_raw( remove_query_arg( [ 'process_early_renewal', 'subscription_id', 'wcs_nonce' ] ) ),
218218
'early_renewal' => true,
219219
],
220220
WC_AJAX::get_endpoint( 'wc_stripe_verify_intent' )

includes/connect/class-wc-stripe-connect.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function maybe_handle_redirect() {
8787
if ( isset( $_GET['wcs_stripe_code'], $_GET['wcs_stripe_state'] ) ) {
8888

8989
$response = $this->connect_oauth( wc_clean( wp_unslash( $_GET['wcs_stripe_state'] ) ), wc_clean( wp_unslash( $_GET['wcs_stripe_code'] ) ) );
90-
wp_safe_redirect( remove_query_arg( [ 'wcs_stripe_state', 'wcs_stripe_code' ] ) );
90+
wp_safe_redirect( esc_url_raw( remove_query_arg( [ 'wcs_stripe_state', 'wcs_stripe_code' ] ) ) );
9191
exit;
9292

9393
// redirect from credentials reset
@@ -99,11 +99,13 @@ public function maybe_handle_redirect() {
9999

100100
$this->clear_stripe_keys();
101101
wp_safe_redirect(
102-
remove_query_arg(
103-
[
104-
'_wpnonce',
105-
'reset_stripe_api_credentials',
106-
]
102+
esc_url_raw(
103+
remove_query_arg(
104+
[
105+
'_wpnonce',
106+
'reset_stripe_api_credentials',
107+
]
108+
)
107109
)
108110
);
109111
exit;

readme.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ If you get stuck, you can ask for help in the Plugin Forum.
128128

129129
== Changelog ==
130130

131-
= 6.4.0 - 2022-05-20 =
132-
* Fix - Changed logic for how 'Enabled/Disabled' statuses are shown for payments and payouts capabilities in settings.
133-
* Tweak - Updated the minimum supported versions of WordPress and WooCommerce.
131+
= 6.4.1 - 2022-xx-xx =
132+
* Fix - Ensure proper URL formatting.
134133

135134
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)