#32229 closed defect (bug) (fixed)
redirect_canonical - Undefined Index HTTP_HOST
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 4.2.1 |
| Component: | Canonical | Keywords: | has-patch commit |
| Focuses: | administration | Cc: |
Description
One of my more popular installs is getting its debug.log blasted with notices:
PHP Notice: Undefined index: HTTP_HOST in /wp-includes/canonical.php on line 63
Which is in this conditional block of redirect_canonical
if ( !$requested_url ) {
// build the URL in the address bar
$requested_url = is_ssl() ? 'https://' : 'http://';
$requested_url .= $_SERVER['HTTP_HOST'];
$requested_url .= $_SERVER['REQUEST_URI'];
}
This is more than likely being generated by bots hitting pages that no longer exist or have never existed. I created a support topic on the issue which then was told to create a ticket. I believe my 2nd notice ( in the support question ) is also related.
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
I've also created a
debug_backtraceof the issue incase it's any help:Array ( [0] => Array ( [function] => redirect_canonical [args] => Array ( [0] => ) ) [1] => Array ( [file] => /httpdocs/wp-includes/plugin.php [line] => 496 [function] => call_user_func_array [args] => Array ( [0] => redirect_canonical [1] => Array ( [0] => ) ) ) [2] => Array ( [file] => /httpdocs/wp-includes/template-loader.php [line] => 12 [function] => do_action [args] => Array ( [0] => template_redirect ) ) [3] => Array ( [file] => /httpdocs/wp-blog-header.php [line] => 16 [args] => Array ( [0] => /httpdocs/wp-includes/template-loader.php ) [function] => require_once ) [4] => Array ( [file] => /httpdocs/index.php [line] => 17 [args] => Array ( [0] => /httpdocs/wp-blog-header.php ) [function] => require ) )Also a related bug:
PHP Notice: Undefined index: HTTP_HOST in /httpdocs/wp-includes/nav-menu-template.php on line 549If need be I can create a
debug_backtraceon that too.