Active plugins array sanity check. If the array isn't an array, reset it.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-04-04 02:48:18 +00:00
parent ee95c85ec9
commit 267d1c519b
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,16 @@ require_once('admin-header.php');
// If any plugins don't exist, axe 'em // If any plugins don't exist, axe 'em
$check_plugins = get_settings('active_plugins'); $check_plugins = get_settings('active_plugins');
// Sanity check. If the active plugin list is not an array, make it an
// empty array.
if ( !is_array($check_plugins) ) {
$check_plugins = array();
update_option('active_plugins', $check_plugins);
}
// If a plugin file does not exist, remove it from the list of active
// plugins.
foreach ($check_plugins as $check_plugin) { foreach ($check_plugins as $check_plugin) {
if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) { if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) {
$current = get_settings('active_plugins'); $current = get_settings('active_plugins');