Require active plugin files to end in .php. Props hakre. fixes #9406
git-svn-id: https://develop.svn.wordpress.org/trunk@10892 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
49797a374a
commit
afc2b737b9
@ -512,16 +512,22 @@ if ( get_option('hack_file') ) {
|
|||||||
require(ABSPATH . 'my-hacks.php');
|
require(ABSPATH . 'my-hacks.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) {
|
$current_plugins = get_option('active_plugins');
|
||||||
$current_plugins = get_option('active_plugins');
|
if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) {
|
||||||
if ( is_array($current_plugins) ) {
|
foreach ( $current_plugins as $plugin ) {
|
||||||
foreach ( $current_plugins as $plugin ) {
|
// check the $plugin filename
|
||||||
if ( '' != $plugin && 0 == validate_file($plugin) && file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
|
// Validate plugin filename
|
||||||
include_once(WP_PLUGIN_DIR . '/' . $plugin);
|
if ( validate_file($plugin) // $plugin must validate as file
|
||||||
}
|
|| '.php' != substr($plugin, -4) // $plugin must end with '.php'
|
||||||
unset($plugin);
|
|| !file_exists(WP_PLUGIN_DIR . '/' . $plugin) // $plugin must exist
|
||||||
|
)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
include_once(WP_PLUGIN_DIR . '/' . $plugin);
|
||||||
}
|
}
|
||||||
|
unset($plugin);
|
||||||
}
|
}
|
||||||
|
unset($current_plugins);
|
||||||
|
|
||||||
require (ABSPATH . WPINC . '/pluggable.php');
|
require (ABSPATH . WPINC . '/pluggable.php');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user