[wp-trac] [WordPress Trac] #51286: Error during installation at step 1 - Undefined index: host

WordPress Trac noreply at wordpress.org
Thu Sep 10 10:39:43 UTC 2020


#51286: Error during installation at step 1 - Undefined index: host
--------------------------+-----------------------------
 Reporter:  grapestain    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  I18N          |    Version:  5.5.1
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 It is another instance of this one:
 https://core.trac.wordpress.org/ticket/34164

 If the environment is set up to report all errors, line 1075 of `wp-
 includes/l10n.php` creates an `E_NOTICE` with `Undefined index: host`
 message.

 Reason:
 At the time of installation the `$site_url` array does not yet have a
 `'host'` key, so `$site_url['host']` is undefined.

 You can see here:
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/l10n.php#L1075
 `} elseif ( ! isset( $src_url['host'] ) || $src_url['host'] ===
 $site_url['host'] ) {`

 A proper condition would look like:
 `} elseif ( ! isset( $src_url['host'] ) || ( isset($site_url['host']) &&
 $src_url['host'] === $site_url['host'] ) ) {`

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


More information about the wp-trac mailing list