[wp-trac] [WordPress Trac] #62245: ErrorException: Warning: Undefined array key "host"

WordPress Trac noreply at wordpress.org
Thu Oct 17 14:32:15 UTC 2024


#62245: ErrorException: Warning: Undefined array key "host"
-------------------------------------------------+-------------------------
 Reporter:  jhobden600                           |      Owner:  (none)
     Type:  defect (bug)                         |     Status:  new
 Priority:  normal                               |  Milestone:  Awaiting
                                                 |  Review
Component:  General                              |    Version:
 Severity:  normal                               |   Keywords:
  Focuses:  coding-standards, php-compatibility  |
-------------------------------------------------+-------------------------
 Occasionally I see in the logs the {{{$original['host']}}} value is
 undefined on line 716 in {{{wp-includes/canonical.php}}}. I'm not sure if
 it's bots, or a local script triggering this error, but it seems to be
 possible on occasion for the array key {{{'host'}}} to be missing.

 Either way, there should be a check that the value of
 {{{$original['host']}}} isset, before proceeding. I suggest


 {{{
 if (!isset($original['host'])){
     $original['host'] = '';
 }
 }}}



 is added on line 715 in {{{wp-includes/canonical.php}}} to prevent the
 warning.

 PHP version 8.3.6. Using latest WordPress version 6.6.2.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62245>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list