From 36639a2b7178347e7cd2482b8c635e55ccfc5ed0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 4 Apr 2005 02:48:18 +0000 Subject: [PATCH] Active plugins array sanity check. If the array isn't an array, reset it. git-svn-id: https://develop.svn.wordpress.org/trunk@2514 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/plugins.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 61d33ea57d..ffd4971bc5 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -29,6 +29,16 @@ require_once('admin-header.php'); // If any plugins don't exist, axe 'em $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) { if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) { $current = get_settings('active_plugins');