]> granicus.if.org Git - php/commitdiff
add some checks to increase cache integrity
authorChristian Dickmann <dickmann@php.net>
Sun, 24 Nov 2002 10:13:57 +0000 (10:13 +0000)
committerChristian Dickmann <dickmann@php.net>
Sun, 24 Nov 2002 10:13:57 +0000 (10:13 +0000)
pear/PEAR/Remote.php

index 0d1a11556c33b0e59a8b5a599160a88382add52f..6925906c8b3a8986fb237bd87cbc8eaff3e4b4e8 100644 (file)
@@ -108,13 +108,15 @@ class PEAR_Remote extends PEAR
         $this->cache = $this->getCache($args);
         $cachettl = $this->config->get('cache_ttl');
         // If cache is newer than $cachettl seconds, we use the cache!
-        if ($this->cache !== null && $this->cache['age'] < $cachettl) {
+        if ($this->cache !== null && $this->cache['age'] < $cachettl && is_array($this->cache['content'])) {
             return $this->cache['content'];
         };
         
         if (extension_loaded("xmlrpc")) {
             $result = call_user_func_array(array(&$this, 'call_epi'), $args);
-            $this->saveCache($_args, $result);
+            if (!PEAR::isError($result)) {
+                $this->saveCache($_args, $result);
+            };
             return $result;
         }
         if (!@include_once("XML/RPC.php")) {