Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit 84e543c

Browse files
author
Justin Shreve
committed
Properly handle URLs with paths in them
1 parent 55e4a25 commit 84e543c

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

hotfixes/wc-api-dev-email-order-url.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
/**
33
* Provides a hotfix that points the admin order URL to WordPress.com instead of wp-admin.
44
*
5-
* @since 0.8.2
5+
* @since 0.8.3
66
*/
77

88
if ( ! defined( 'ABSPATH' ) ) {
99
exit;
1010
}
1111

1212
function wc_api_dev_email_get_wpcom_order_link( $order_id ) {
13-
$site_slug = preg_replace( '/^https?:\/\//', '', get_site_url() );
13+
$strip_http = '/.*?:\/\//i';
14+
$site_slug = preg_replace( $strip_http, '', get_home_url() );
15+
$site_slug = str_replace( '/', '::', $site_slug );
16+
1417
return 'https://wordpress.com/store/order/' . $site_slug . '/' . absint( $order_id );
1518
}
1619

readme.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes
33
Tags: woocommerce, rest-api, api
44
Requires at least: 4.6
55
Tested up to: 4.8
6-
Stable tag: 0.8.2
6+
Stable tag: 0.8.3
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -25,9 +25,11 @@ This section describes how to install the plugin and get it working.
2525

2626
== Changelog ==
2727

28+
= 0.8.3 =
29+
* Fix - Update order link in order details emails.
30+
2831
= 0.8.2 =
2932
* Fix - Don't auto enable the PayPal payment method.
30-
* Fix - Update order link in order details emails.
3133

3234
= 0.8.1 =
3335
* Fix - Fix auto plugin update logic

wc-api-dev.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce API Dev
44
* Plugin URI: https://woocommerce.com/
55
* Description: A feature plugin providing a bleeding edge version of the WooCommerce REST API.
6-
* Version: 0.8.2
6+
* Version: 0.8.3
77
* Author: Automattic
88
* Author URI: https://woocommerce.com
99
* Requires at least: 4.4
@@ -33,7 +33,7 @@ class WC_API_Dev {
3333
/**
3434
* Current version of the API plugin.
3535
*/
36-
const CURRENT_VERSION = '0.8.2';
36+
const CURRENT_VERSION = '0.8.3';
3737

3838
/**
3939
* Minimum version needed to run this version of the API.

0 commit comments

Comments
 (0)