{"id":9298802,"date":"2017-07-07T14:27:07","date_gmt":"2017-07-07T14:27:07","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-notice-92\/"},"modified":"2017-07-07T14:27:07","modified_gmt":"2017-07-07T14:27:07","slug":"php-notice-92","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-notice-92\/","title":{"rendered":"PHP Notice"},"content":{"rendered":"<p>Hello<br \/>\nI have a php notice :<br \/>\n[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 44<\/p>\n<p>static function init() {<\/p>\n<p>    global $wp;<\/p>\n<p>    \/\/ Get routes<br \/>\n    self::$route = $wp-&gt;request;<br \/>\n    self::$routes = explode(&#8216;\/&#8217;, self::$route);<\/p>\n<p>    \/\/ Get queries: direct method<br \/>\n    $request_url = untrailingslashit( &#8216;http:\/\/&#8217; . $_SERVER[&#8216;HTTP_HOST&#8217;] . $_SERVER[&#8216;REQUEST_URI&#8217;] );<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/12347048\/undefined-index-http-host-even-though-it-is-checked\" target=\"_blank\">https:\/\/stackoverflow.com\/questions\/12347048\/undefined-index-http-host-even-though-it-is-checked<\/a><\/p>\n<p>You need test $_SERVER[&#8216;HTTP_HOST&#8217;] is set before use it<\/p>\n<p>regards <\/p>\n","protected":false},"template":"","class_list":["post-9298802","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9298802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9298802\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9298802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}