[wp-trac] [WordPress Trac] #34353: redirect_canonical() – Undefined indexes 'host' and 'scheme'

WordPress Trac noreply at wordpress.org
Thu Jul 28 10:15:32 UTC 2022


#34353: redirect_canonical() – Undefined indexes 'host' and 'scheme'
-------------------------------------------------+-------------------------
 Reporter:  theamila                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Canonical                            |     Version:  4.3.1
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests has-patch needs-    |     Focuses:
  testing-info                                   |
-------------------------------------------------+-------------------------

Comment (by jojooba008):

 I tried running your script and got the error as well.
 However, the message seems to be a little different from yours...?

 {{{
 [28-Jul-2022 09:53:59 UTC] PHP Notice:  Undefined index: host in /xxxxx
 /wp-includes/canonical.php on line 687
 [28-Jul-2022 09:53:59 UTC] PHP Notice:  Undefined index: host in /xxxxx
 /wp-includes/canonical.php on line 696
 [28-Jul-2022 09:53:59 UTC] PHP Notice:  Undefined index: host in /xxxxx
 /wp-includes/canonical.php on line 699
 }}}

 I also tried running it with "http1.0" as "http1.1" and this time no error
 appears.


 Replying to [comment:43 Mayhem30]:
 > I found the issue and how to consistently reproduce the error.
 >
 >
 > {{{
 > $ curl --http1.0 -H 'User-Agent:' -H 'Accept:' -H 'Host:'
 https://example.com
 > }}}
 >
 >
 >
 > {{{
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 687
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 696
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 699
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "scheme" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 720
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 687
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 696
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "host" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 699
 > [22-Jul-2022 02:00:40 UTC] PHP Warning:  Undefined array key "scheme" in
 /www/example.com/httpdocs/wp-includes/canonical.php on line 720
 > }}}
 >
 > I'm curious if anyone else with shell access have the same results with
 their blog?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/34353#comment:44>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list