summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-08-30 01:41:59 -0700
committerAleksander Machniak <alec@alec.pl>2013-08-30 01:41:59 -0700
commitd6eaa8eaf6f8108b0b4558229b04415e62586d2a (patch)
tree293e270ef727ca1bfe61e02f6497ffb43bbf022e /program
parentf49e28e4a6ec515ff4d965cf8ad7821e7258406e (diff)
parentde8687f9f11d49d36b322af72f644f7c5a232b9f (diff)
Merge pull request #111 from dpc22/temp_dir_ttl
Add temp_dir_ttl configuration option
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index af9c069cf..d9c3dd8b9 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -498,7 +498,14 @@ class rcube
public function gc_temp()
{
$tmp = unslashify($this->config->get('temp_dir'));
- $expire = time() - 172800; // expire in 48 hours
+
+ // expire in 48 hours by default
+ $temp_dir_ttl = $this->config->get('temp_dir_ttl', '48h');
+ $temp_dir_ttl = get_offset_sec($temp_dir_ttl);
+ if ($temp_dir_ttl < 6*3600)
+ $temp_dir_ttl = 6*3600; // 6 hours sensible lower bound.
+
+ $expire = time() - $temp_dir_ttl;
if ($tmp && ($dir = opendir($tmp))) {
while (($fname = readdir($dir)) !== false) {