aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/poller.php13
-rw-r--r--include/text.php2
2 files changed, 14 insertions, 1 deletions
diff --git a/include/poller.php b/include/poller.php
index f165ad590..65fafda4c 100755
--- a/include/poller.php
+++ b/include/poller.php
@@ -69,6 +69,19 @@ function poller_run($argv, $argc){
// clear old cache
Cache::clear();
+ // clear item cache files if they are older than one day
+ $cache = get_config('system','itemcache');
+ if (($cache != '') and is_dir($cache)) {
+ if ($dh = opendir($cache)) {
+ while (($file = readdir($dh)) !== false) {
+ $fullpath = $cache."/".$file;
+ if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 1800))
+ unlink($fullpath);
+ }
+ closedir($dh);
+ }
+ }
+
$manual_id = 0;
$generation = 0;
$hub_update = false;
diff --git a/include/text.php b/include/text.php
index 5bf815105..08c5a5424 100644
--- a/include/text.php
+++ b/include/text.php
@@ -879,7 +879,7 @@ function prepare_body($item,$attach = false) {
$cache = get_config('system','itemcache');
if (($cache != '')) {
- $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach."-".hash("crc32", $item['body']);
+ $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']);
if (file_exists($cachefile))
$s = file_get_contents($cachefile);