summaryrefslogtreecommitdiff
path: root/lib/SimplePie/SimplePie.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-31 16:57:11 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-31 16:57:11 +0100
commit54479a5027d83b5dc8deee5e2795c9d89c732ba0 (patch)
tree7ae55930f3ab6d5e2a548784e4d7561809f7c68c /lib/SimplePie/SimplePie.php
parentcff8636e770b2072a41928cd918b37654c0dafbb (diff)
parent724e13f0a6419b046b33da71e66058e279551edd (diff)
Merge branch 'dev' into beta
Conflicts: CHANGELOG README.fr.md README.md app/Controllers/feedController.php app/Controllers/indexController.php app/i18n/en.php app/i18n/fr.php app/views/helpers/view/normal_view.phtml app/views/stats/index.phtml app/views/stats/repartition.phtml constants.php p/scripts/main.js
Diffstat (limited to 'lib/SimplePie/SimplePie.php')
-rw-r--r--lib/SimplePie/SimplePie.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php
index 06c100f59..84001dd9a 100644
--- a/lib/SimplePie/SimplePie.php
+++ b/lib/SimplePie/SimplePie.php
@@ -1455,7 +1455,11 @@ class SimplePie
{
// Load the Cache
$this->data = $cache->load();
- if (!empty($this->data))
+ if ($cache->mtime() + $this->cache_duration > time()) { //FreshRSS
+ $this->raw_data = false;
+ return true; // If the cache is still valid, just return true
+ }
+ elseif (!empty($this->data))
{
// If the cache is for an outdated build of SimplePie
if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD)
@@ -1487,7 +1491,7 @@ class SimplePie
}
}
// Check if the cache has been updated
- elseif ($cache->mtime() + $this->cache_duration < time())
+ else //if ($cache->mtime() + $this->cache_duration < time()) //FreshRSS removed
{
// If we have last-modified and/or etag set
//if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) //FreshRSS removed
@@ -1516,6 +1520,7 @@ class SimplePie
}
else
{
+ $cache->touch(); //FreshRSS
$this->error = $file->error; //FreshRSS
return !empty($this->data); //FreshRSS
//unset($file); //FreshRSS removed
@@ -1533,17 +1538,18 @@ class SimplePie
}
}
}
- // If the cache is still valid, just return true
- else
- {
- $this->raw_data = false;
- return true;
- }
+ //// If the cache is still valid, just return true
+ //else //FreshRSS removed
+ //{
+ // $this->raw_data = false;
+ // return true;
+ //}
}
// If the cache is empty, delete it
else
{
- $cache->unlink();
+ //$cache->unlink(); //FreshRSS removed
+ $cache->touch(); //FreshRSS
$this->data = array();
}
}