From 2577287a6700ce024e3fd62fa9048f52541eb1e9 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Fri, 23 Jul 2004 09:26:37 +0000 Subject: [PATCH] Whoops! git-svn-id: http://svn.automattic.com/wordpress/trunk@1480 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 3febba371f..9e70620c6a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -296,10 +296,13 @@ function get_settings($setting) { if ('home' == $setting && '' == $cache_settings->home) return $cache_settings->siteurl; - if ( isset($cache_settings->$setting) ) + if ( isset($cache_settings->$setting) ) : return $cache_settings->$setting; - else - return @ unserialize( $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'") ); + else : + $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); + if (@ $kellogs = unserialize($option) ) return $kellogs; + else return $option; + endif; } function get_alloptions() { @@ -311,7 +314,9 @@ function get_alloptions() { if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); - @$all_options->{$option->option_name} = unserialize($option->option_value); + if (@ $value = unserialize($option->option_value) ) return $value; + else $value = $option->option_value; + $all_options->{$option->option_name} = $value; } } return $all_options;