From e5d942f41163662e99d9aebea162f207ba9e209e Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sat, 1 Jan 2005 22:09:08 +0000 Subject: [PATCH] Added check if Snoopy exists, and two fairly major bugs in the dashboard. update_option was not serializing objects and $cache->get() wasn't checking for the correct option name. git-svn-id: http://svn.automattic.com/wordpress/trunk@2027 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-snoopy.php | 4 +++- wp-includes/functions.php | 2 +- wp-includes/rss-functions.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-snoopy.php b/wp-includes/class-snoopy.php index 532ecba10..7c4ec6a30 100644 --- a/wp-includes/class-snoopy.php +++ b/wp-includes/class-snoopy.php @@ -35,6 +35,7 @@ http://snoopy.sourceforge.com *************************************************/ +if ( !in_array('Snoopy', get_declared_classes() ) ) : class Snoopy { /**** Public variables ****/ @@ -895,5 +896,6 @@ class Snoopy return $postdata; } } +endif; -?> +?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 3a808a55e..380c31118 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -366,7 +366,7 @@ function get_alloptions() { function update_option($option_name, $newvalue) { global $wpdb, $cache_settings; - if ( is_array($newvalue) || is_object($value) ) + if ( is_array($newvalue) || is_object($newvalue) ) $newvalue = serialize($newvalue); $newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim diff --git a/wp-includes/rss-functions.php b/wp-includes/rss-functions.php index 480b48138..e89e2a970 100644 --- a/wp-includes/rss-functions.php +++ b/wp-includes/rss-functions.php @@ -414,7 +414,7 @@ function fetch_rss ($url) { // return cache HIT, MISS, or STALE $cache_status = $cache->check_cache( $url ); } - + // if object cached, and cache is fresh, return cached obj if ( $cache_status == 'HIT' ) { $rss = $cache->get( $url ); @@ -676,7 +676,7 @@ class RSSCache { \*=======================================================================*/ function get ($url) { $this->ERROR = ""; - $cache_option = $this->file_name( $url ); + $cache_option = 'rss_' . $this->file_name( $url ); if ( ! get_option( $cache_option ) ) { $this->debug(