WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#3909 closed defect (bug) (fixed)

Plugin handling Inconsistency as a consequence of ticket #3157

Reported by: z720 Owned by:
Milestone: 2.2 Priority: low
Severity: normal Version: 2.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

I saw in ticket #3157 that constant PLUGINDIR was introduced instead of "wp-content/plugins", well but the job is half done...

When modified in wp-config.php PLUGINDIR works well for the admin part : the plugins get detected in the admin and can be activated. But they are totally ineffective in the frontend because they don't get loaded.

I found in wp-settings.php (in the trunk) at line 200

if ( get_option('active_plugins') ) {
	$current_plugins = get_option('active_plugins');
	if ( is_array($current_plugins) ) {
		foreach ($current_plugins as $plugin) {
			if ('' != $plugin && file_exists(ABSPATH . 'wp-content/plugins/' . $plugin))
				include_once(ABSPATH . 'wp-content/plugins/' . $plugin);
		}
	}
}

but it should be :

if ( get_option('active_plugins') ) {
	$current_plugins = get_option('active_plugins');
	if ( is_array($current_plugins) ) {
		foreach ($current_plugins as $plugin) {
			if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . $plugin))
				include_once(ABSPATH . PLUGINDIR . $plugin);
		}
	}
}

as PLUGINDIR is defined around line 95.

Attachments (1)

3909.diff (1.1 KB) - added by Nazgul 7 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 markjaquith7 years ago

  • Milestone changed from 2.1.3 to 2.2

You'd need a slash between PLUGINDIR and $plugin

comment:2 ryan7 years ago

Somebody cook up a diff.

Nazgul7 years ago

comment:3 Nazgul7 years ago

  • Keywords has-patch added

Patch based on given code snippet. I also included another reference in plugins.php.

comment:4 ryan7 years ago

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

(In [4972]) Use PLUGINDIR. Props z720 and Nazgul. fixes #3909

Note: See TracTickets for help on using tickets.