[wp-trac] [WordPress Trac] #39419: Explicitly globalize global variables in ms-settings.php

WordPress Trac noreply at wordpress.org
Thu Dec 29 08:25:44 UTC 2016


#39419: Explicitly globalize global variables in ms-settings.php
----------------------------------------+-----------------------------
 Reporter:  danielbachhuber             |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Bootstrap/Load              |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  multisite
----------------------------------------+-----------------------------

Comment (by jeremyfelt):

 Yeah, I'm on board with explicit.

 * `$blog_id` is declared in `wp-settings.php` as of [34961], so that
 should be okay already.
 * I [https://core.trac.wordpress.org/ticket/34217#comment:3 noted
 previously] that `$site_id` and `$public` are no longer used anywhere by
 core. It'd be great if we could just null these out, but who knows what
 would break. Note that we kind of accidentally did this with `$sites` and
 it only came up once. See #29415.
 * `$path` is used in `validate_another_blog_signup()`, probably by other
 plugins, etc..
 * `$domain` is used in `wpmu_validate_blog_signup()`, and possibly
 elsewhere.
 * `$table_prefix` is at least used a few times (object cache drop-ins,
 `wp_set_wpdb_vars()`). It's first used in `wp-settings.php`, so should be
 defined there as well.

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


More information about the wp-trac mailing list