[wp-trac] [WordPress Trac] #34353: redirect_canonical() – Undefined indexes 'host' and 'scheme'
WordPress Trac
noreply at wordpress.org
Fri Aug 29 13:12:57 UTC 2025
#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: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Comment (by Andy Schmidt):
Replying to [comment:74 mikemeinz]:
> I temporarily added an **error_log($requested_url)** call to
canonical.php to see if I could determine the cause.
> I found that, in some cases, the $requested_url was malformed.
> I added this after line 78 to verify that the $original array was
populated correctly and if not exit the function.
If you go back to post #10 from 8 years ago, I had found the same (in my
case the URL was "/" - so no host) and I circumvented it similar to your
suggestion.
It's a trivial fix to a very obvious problem - yet after 8 years, it still
fills people's logs.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34353#comment:75>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list