mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
add some checks to increase cache integrity
This commit is contained in:
parent
7dd3e5e683
commit
0228cfcf4a
1 changed files with 4 additions and 2 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue