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
This commit is contained in:
parent
04d470cbbd
commit
e5d942f411
|
@ -35,6 +35,7 @@ http://snoopy.sourceforge.com
|
||||||
|
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
|
if ( !in_array('Snoopy', get_declared_classes() ) ) :
|
||||||
class Snoopy
|
class Snoopy
|
||||||
{
|
{
|
||||||
/**** Public variables ****/
|
/**** Public variables ****/
|
||||||
|
@ -895,5 +896,6 @@ class Snoopy
|
||||||
return $postdata;
|
return $postdata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -366,7 +366,7 @@ function get_alloptions() {
|
||||||
|
|
||||||
function update_option($option_name, $newvalue) {
|
function update_option($option_name, $newvalue) {
|
||||||
global $wpdb, $cache_settings;
|
global $wpdb, $cache_settings;
|
||||||
if ( is_array($newvalue) || is_object($value) )
|
if ( is_array($newvalue) || is_object($newvalue) )
|
||||||
$newvalue = serialize($newvalue);
|
$newvalue = serialize($newvalue);
|
||||||
|
|
||||||
$newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim
|
$newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim
|
||||||
|
|
|
@ -414,7 +414,7 @@ function fetch_rss ($url) {
|
||||||
// return cache HIT, MISS, or STALE
|
// return cache HIT, MISS, or STALE
|
||||||
$cache_status = $cache->check_cache( $url );
|
$cache_status = $cache->check_cache( $url );
|
||||||
}
|
}
|
||||||
|
|
||||||
// if object cached, and cache is fresh, return cached obj
|
// if object cached, and cache is fresh, return cached obj
|
||||||
if ( $cache_status == 'HIT' ) {
|
if ( $cache_status == 'HIT' ) {
|
||||||
$rss = $cache->get( $url );
|
$rss = $cache->get( $url );
|
||||||
|
@ -676,7 +676,7 @@ class RSSCache {
|
||||||
\*=======================================================================*/
|
\*=======================================================================*/
|
||||||
function get ($url) {
|
function get ($url) {
|
||||||
$this->ERROR = "";
|
$this->ERROR = "";
|
||||||
$cache_option = $this->file_name( $url );
|
$cache_option = 'rss_' . $this->file_name( $url );
|
||||||
|
|
||||||
if ( ! get_option( $cache_option ) ) {
|
if ( ! get_option( $cache_option ) ) {
|
||||||
$this->debug(
|
$this->debug(
|
||||||
|
|
Loading…
Reference in New Issue