From 4143fbe12c69b13be2e0baf3c8d90d5167d7e6f0 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Fri, 23 Jul 2004 09:26:37 +0000 Subject: [PATCH] Whoops! git-svn-id: https://develop.svn.wordpress.org/trunk@1480 602fd350-edb4-49c9-b593-d223f7449a82 --- 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;