[wp-trac] [WordPress Trac] #28697: Fix ms_subdomain_constants()

WordPress Trac noreply at wordpress.org
Mon Jun 30 21:10:17 UTC 2014

#28697: Fix ms_subdomain_constants()
 Reporter:  TobiasBg        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  4.0
Component:  Bootstrap/Load  |    Version:  3.0
 Severity:  normal          |   Keywords:  has-patch
  Focuses:  multisite       |
 `ms_subdomain_constants()` brings parity between the `SUBDOMAIN_INSTALL`
 and the deprecated `VHOST` constants, introduced in [14452].

 It's a two-step process, where the first run of the function checks and
 sets the constants as necessary, and where the second run is used to print
 debug warnings/errors.

 However, the function does not account for "internal success". If the
 `VHOST` constant was not set (it shouldn't be anymore), it doesn't set
 `$error=false;` so that all checks are unnecessarily performed again in
 the next evaluation of the function (the if-condition `false === $error`
 further up in the function is never true).
 (If one then runs the function for a third time, an error will be shown,
 although nothing was wrong initially.)

 Also, one of the if-conditions can be simplified.

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

More information about the wp-trac mailing list