Opened 2 years ago
Closed 2 years ago
#62245 closed defect (bug) (duplicate)
ErrorException: Warning: Undefined array key "host"
| Reported by: | jhobden600 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Canonical | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
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.
Change History (2)
#2
@
2 years ago
- Component General → Canonical
- Focuses coding-standards php-compatibility removed
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
Welcome to Trac, @jhobden600, and thanks for the report!
This issue is being tracked over in #34353, where you are invited to help move this forward.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I created a PR here: https://github.com/jameshobden/wordpress-develop/pull/1/commits/5af4ae6e3b497993e3dbe579f040c57f91b908d6