Opened 9 years ago
Closed 9 years ago
#34164 closed defect (bug) (fixed)
Error during installation at step 1 - Undefined index: host
Reported by: | jlambe | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | HTTP API | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
I've setup my local configuration to report all type of errors.
During a fresh installation of WordPress 4.3.1, at Step 1, WordPress triggers an error where the code tries to look at the array key host
which is not yet defined.
The error seems to be in the following file: wp-includes/http.php on line 468
Here is a copy of the thrown exception:
Unhandled Exception
Message:
Undefined index: host
Location:
*/wp-includes/http.php on line 468
Attachments (2)
Change History (18)
#2
follow-up:
↓ 3
@
9 years ago
Hi @jeremyfelt,
I haven't tested again yet but I have reports that the issue happens only when you choose a language different than default english.
#3
in reply to:
↑ 2
@
9 years ago
Replying to jlambe:
Hi @jeremyfelt,
I haven't tested again yet but I have reports that the issue happens only when you choose a language different than default english.
As @jlambe said, I'm getting the same error when I choose a different language than english.
PS: It looks like a default host option it's not setted.
#4
@
9 years ago
PS: I changed the 466 line in http.php and got it working, even w/ another languages.
//OLD
$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
//NEW
$same_host = strtolower( $parsed_url['host'] );
#5
@
9 years ago
- Keywords needs-patch good-first-bug added; reporter-feedback removed
- Milestone changed from Awaiting Review to Future Release
- Version set to 4.0
Thanks for the additional info. I'm able to replicate this as well, not sure why the notice wasn't showing before.
When another language is selected during installation, an HTTP request is made to retrieve the language pack. In wp_http_validate_url()
we check the host of the URL against the host of the current site to see if it an external request that requires additional validation. We don't take currently take into consideration that no host has been set for the current site yet, so that comparison generates a notice.
A similar issue was fixed via #28648 in [28865]. We should treat this similarly and mark the URL as an external host if no host has yet been set.
#7
@
9 years ago
- Keywords needs-patch added; has-patch removed
Thanks for the patch @perezlabs. We'll want to keep the comparison between the site's host and the host being parsed. If one is available, it needs to be checked properly. See [28865] for an example approach. If the host is available, check it. If the host is not available, assume it is an external URL.
#10
@
9 years ago
- Owner set to perezlabs
- Status changed from new to assigned
Marking the good first bug as claimed.
Hi @jlambe, thanks for the ticket. I'm not able to confirm any issues in trunk with a fresh install of WordPress and no plugins.
Can you provide steps to replicate the issue?