[wp-trac] [WordPress Trac] #15936: IPv6 literal support in multisite broken

WordPress Trac noreply at wordpress.org
Tue Nov 5 06:46:40 UTC 2019


#15936: IPv6 literal support in multisite broken
--------------------------------------+-------------------------
 Reporter:  jmdh                      |       Owner:  jeremyfelt
     Type:  enhancement               |      Status:  accepted
 Priority:  normal                    |   Milestone:  5.4
Component:  Networks and Sites        |     Version:  3.0
 Severity:  major                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+-------------------------
Changes (by jeremyfelt):

 * keywords:  has-patch has-unit-tests commit => has-patch has-unit-tests
 * owner:  SergeyBiryukov => jeremyfelt
 * status:  reviewing => accepted


Comment:

 > Does anyone else just think we can remove this code entirely?

 That's a fair question. It seems very likely that we can.

 I poked around a bit and created a checklist of things I think a patch
 should account for:

 * Remove the original `$has_ports` check and accept that port numbers are
 a valid part of a domain and should be stored in the database as such for
 anything other than 80 and 443.
 * As mentioned above, `sanitize_user()` is used to sanitize the domain,
 which strips `:`, so `test.site:8889` becomes `test.site8889`. We should
 consider introducing a `sanitize_domain()` that defines what is allowed in
 a domain string. Any IPv6 literals or addresses with port numbers will
 need to be stored as such in the domain field in order for lookups to
 properly work.
 * There is a check for `'localhost' == $hostname` in `network_step1()`
 that forces a subdomain install and suggests using
 `localhost.localdomain`. This needs to adapt to looking for a port number.
 * There is another check in `allow_subdomain_install()` for `'localhost'
 === $domain` that needs to be adjusted.
 * If this patch is fully accounting for IPv6 literals, then the code
 preventing IP addresses and `localhost` from being used in a subdomain
 install should also be updated to prevent IPv6 literals.
 * Right now there's a general "Because your installation is in a
 directory," message if not `localhost` and if `!
 allow_subdomain_install()`. It'd be worth thinking of a better way to
 phrase that for any case in which subdomains are not supported. Or just
 add yet another `elseif`. :)
 * Tests should be updated to account for domains with ports and IPv6
 addresses as well as the standard 80/443.

 That list may not be comprehensive, though I did poke around at various
 things quite a bit. Let's take off the commit tag for now and iterate on
 this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/15936#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list