From 2ef44d91a18b5bf8286da5c791914fd73895e90e Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Sun, 22 Dec 2019 22:28:41 +0800 Subject: [PATCH] Remove notices --- includes/core/class-permalinks.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/core/class-permalinks.php b/includes/core/class-permalinks.php index bc6a2060..304b68be 100644 --- a/includes/core/class-permalinks.php +++ b/includes/core/class-permalinks.php @@ -136,9 +136,14 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) { //check if WP-CLI there isn't set HTTP_HOST, use localhost instead if ( defined( 'WP_CLI' ) && WP_CLI ) { $host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost'; - } else { - $host = $_SERVER['HTTP_HOST']; - } + } else{ + if ( isset( $_SERVER['HTTP_HOST'] ) ) { + $host = $_SERVER['HTTP_HOST']; + }else + $host = 'localhost'; + } + } + $page_url = ( is_ssl() ? 'https://' : 'http://' ) . $host . $_SERVER['REQUEST_URI']; if ( $no_query_params == true ) {