PHP Notice
-
Hello
I have a php notice :
[07-Jul-2017 14:20:00 UTC] PHP Notice: Undefined index: HTTP_HOST in wp-content/plugins/custom-content-shortcode/includes/modules/url.php on line 44static function init() {
global $wp;
// Get routes
self::$route = $wp->request;
self::$routes = explode(‘/’, self::$route);// Get queries: direct method
$request_url = untrailingslashit( ‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’] );https://stackoverflow.com/questions/12347048/undefined-index-http-host-even-though-it-is-checked
You need test $_SERVER[‘HTTP_HOST’] is set before use it
regards
The topic ‘PHP Notice’ is closed to new replies.