Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#21115 closed defect (bug) (fixed)

Remove ancient wp-settings.php global unsetting code

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Unit Tests Keywords:
Focuses: Cc:

Description

We have this:

// Ensure these global variables do not exist so they do not interfere with WordPress.
unset( $wp_filter, $cache_lastcommentmodified );

It used to include more variables, but they were removed when a few of us took an axe to wp-settings.php back in 3.0.

I suggest we remove both. $cache_lastcommentmodified can easily become a static variable within that function (I mean, we're dealing with pre-1.5 code here) and a lot of things would be broken if people overrode WordPress globals prior to startup, not just $wp_filter.

Attachments (1)

21115.diff (2.3 KB) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (3)

#1 @nacin
13 years ago

Side effect: Removing the unset() for $wp_filter can allow the test suite to add some filters prior to startup, rather than a more explicit re-organization proposed in #20731.

#2 @nacin
13 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21186]:

Remove old code unsetting a few variables in wp-settings.php. fixes #21115.

@nacin
13 years ago

Note: See TracTickets for help on using tickets.