summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-08-25 13:41:48 +0200
committerAleksander Machniak <alec@alec.pl>2013-08-25 13:41:48 +0200
commitcccf8a5b088654148bc080f3dcead92312019686 (patch)
treef2f9985d67fa6ec1c18d9545e8d4b5980b4d3824 /plugins
parentc58cb8aa951e38357f56899a682022f93f47d71f (diff)
Make save() method less memory consumptive, do not return attachment body
Diffstat (limited to 'plugins')
-rw-r--r--plugins/redundant_attachments/redundant_attachments.php7
1 files changed, 4 insertions, 3 deletions
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);