Fallback to home URL if no shop page is set for system status security check.

Fixes #13921
This commit is contained in:
Mike Jolley 2017-04-05 10:03:41 +01:00
parent 57fa8c93fc
commit 811d59feec
1 changed files with 2 additions and 1 deletions

View File

@ -844,8 +844,9 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
* @return array
*/
public function get_security_info() {
$check_page = wc_get_page_id( 'shop' ) ? get_permalink( wc_get_page_id( 'shop' ) ) : get_home_url();
return array(
'secure_connection' => 'https' === substr( get_permalink( wc_get_page_id( 'shop' ) ), 0, 5 ),
'secure_connection' => 'https' === substr( $check_page, 0, 5 ),
'hide_errors' => ! ( defined( 'WP_DEBUG' ) && defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG && WP_DEBUG_DISPLAY ) || 0 === intval( ini_get( 'display_errors' ) ),
);
}