[wp-trac] [WordPress Trac] #57748: Support ports in DOMAIN_CURRENT_SITE for better wp-cli support

WordPress Trac noreply at wordpress.org
Fri Feb 17 08:17:42 UTC 2023


#57748: Support ports in DOMAIN_CURRENT_SITE for better wp-cli support
------------------------------+-----------------------------
 Reporter:  abdullahkasim123  |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 I was tackling [https://github.com/wp-cli/wp-cli/issues/5565 this bug]
 from wp-cli recently.

 It looks like the `wpmu_create_blog()` function is removing the colon
 character from DOMAIN_CURRENT_SITE, as the domain is sanitized by the
 `sanitize_user` function.

 Steps to replicate:
 1. Get a fresh environment started using the `wordpress-develop`
 [https://github.com/WordPress/wordpress-develop repo] by following these
 instructions: https://github.com/WordPress/wordpress-develop#to-start-the-
 development-environment-for-the-first-time
 2. Run `npm run env:cli -- core multisite-convert`
 3. Run `npm run env:cli -- site create --slug="test3" --title="anything"
 --email="yaya at example.com"`
 4. The multisite created would have a link on `http://localhost8889/test3`
 - the colon between the domain and the port is missing.

 I have narrowed down the cause of this issue to this line:
 https://github.com/WordPress/wordpress-
 develop/blob/f8ec8cfe043fdc4fe0dc53044d6ab7a4e927a6cd/src/wp-includes/ms-
 site.php#L506

 I am wondering if we could support ports properly in DOMAIN_CURRENT_SITE,
 hence fixing this bug. It'll allow `wp core multisite-convert` to be used
 in `wordpress-develop` and hence making it easier to do development
 related to multisites.

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


More information about the wp-trac mailing list