From b634b18433bbb9df8aebfbd32a6dd9da0ca141d4 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 21 May 2007 16:39:08 +0000 Subject: [PATCH] Check if is_array before unsetting array index. fixes #4306 for 2.3 git-svn-id: http://svn.automattic.com/wordpress/trunk@5501 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 8dd805d3bb..fd62643440 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -330,7 +330,7 @@ function update_option($option_name, $newvalue) { } $notoptions = wp_cache_get('notoptions', 'options'); - if ( isset($notoptions[$option_name]) ) { + if ( is_array($notoptions) && isset($notoptions[$option_name]) ) { unset($notoptions[$option_name]); wp_cache_set('notoptions', $notoptions, 'options'); } @@ -364,7 +364,7 @@ function add_option($name, $value = '', $description = '', $autoload = 'yes') { // Make sure the option doesn't already exist we can check the cache before we ask for a db query $notoptions = wp_cache_get('notoptions', 'options'); - if ( isset($notoptions[$name]) ) { + if ( is_array($notoptions) && isset($notoptions[$name]) ) { unset($notoptions[$name]); wp_cache_set('notoptions', $notoptions, 'options'); } elseif ( false !== get_option($name) ) {