Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#17761 closed defect (bug) (fixed)

wp-activate.php fails to load properly

Reported by: frumph's profile frumph Owned by: ryan's profile ryan
Milestone: 3.2 Priority: normal
Severity: blocker Version: 3.2
Component: General Keywords: has-patch 2nd-opinion
Focuses: Cc:


wp-activate.php calls get_header(); it comes from the theme, if the theme has functions called from the functions.php it fatal errors out. So noone can activate their registered accounts.

wp-activate.php needs to load up the themes functions.php before calling the get_header(); get_footer();

Attachments (2)

17761.diff (965 bytes) - added by nacin 13 years ago.
17761.2.diff (618 bytes) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.2
  • Severity changed from normal to blocker

Oooh, I had said this wasn't a regression over Twitter, but it is. Broken in [17727].

#2 @nacin
13 years ago

WP_INSTALLING is defined in five situations:

  1. wp-activate.php, unsure original reason, but it prevents non-network plugins (plugins on the main site) from loading
  2. wp-admin/install.php - initial installation
  3. wp-admin/setup-config.php - config file creation
  4. wp-admin/upgrade.php - DB upgrades
  5. wp-includes/ms-functions.php - wpmu_create_blog()

This is a bit of hack, but we could introduce a new WP_ACTIVATING constant that is checked against:

if ( ! defined( 'WP_INSTALLING' ) || defined( 'WP_ACTIVATING' ) ) {

Since WP_INSTALLING is normally not going to be defined, this doesn't add any more overhead to typical pages, only on installing pages, which are already heavy. But it'll prevent an issue on activation.

13 years ago

#3 @nacin
13 years ago

  • Keywords has-patch 2nd-opinion added

13 years ago

#4 @nacin
13 years ago

I realized $pagenow will tell us the PHP_SELF in this case. Second patch does that.

If we want to make this more flexible, we can do a WP_LOAD_THEM_ANYWAY constant. I'm thinking $pagenow is fine.

#5 @ryan
13 years ago

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

In [18263]:

Load the theme's functions.php for wp-activate.php. Props nacin, frumph. fixes #17761

Note: See TracTickets for help on using tickets.