diff options
Diffstat (limited to 'plugins/redundant_attachments')
-rw-r--r-- | plugins/redundant_attachments/config.inc.php.dist | 4 | ||||
-rw-r--r-- | plugins/redundant_attachments/redundant_attachments.php | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/redundant_attachments/config.inc.php.dist b/plugins/redundant_attachments/config.inc.php.dist index a0be3755e..a6d1ad4dc 100644 --- a/plugins/redundant_attachments/config.inc.php.dist +++ b/plugins/redundant_attachments/config.inc.php.dist @@ -4,10 +4,10 @@ // and copies them into sql database. // In environments with replicated database it is possible // to use memcache as a fallback when write-master is unavailable. -$rcmail_config['redundant_attachments_memcache'] = false; +$config['redundant_attachments_memcache'] = false; // Attachment data expires after specied TTL time in seconds (max.2592000). // Default is 12 hours. -$rcmail_config['redundant_attachments_cache_ttl'] = 12 * 60 * 60; +$config['redundant_attachments_cache_ttl'] = 12 * 60 * 60; ?> diff --git a/plugins/redundant_attachments/redundant_attachments.php b/plugins/redundant_attachments/redundant_attachments.php index c0affad3c..91a027586 100644 --- a/plugins/redundant_attachments/redundant_attachments.php +++ b/plugins/redundant_attachments/redundant_attachments.php @@ -126,11 +126,12 @@ class redundant_attachments extends filesystem_attachments $this->_load_drivers(); - if ($args['path']) - $args['data'] = file_get_contents($args['path']); + $data = $args['path'] ? file_get_contents($args['path']) : $args['data']; + + unset($args['data']); $key = $this->_key($args); - $data = base64_encode($args['data']); + $data = base64_encode($data); $status = $this->cache->write($key, $data); |