Merge pull request #13927 from woocommerce/fix/13921

Fallback to home URL if no shop page is set for system status security check.
This commit is contained in:
Claudio Sanches 2017-04-05 14:29:16 -03:00 committed by GitHub
commit 6135aa8175
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 = 0 < 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' ) ),
);
}