From cccf8a5b088654148bc080f3dcead92312019686 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 25 Aug 2013 07:41:48 -0400
Subject: [PATCH] Make save() method less memory consumptive, do not return attachment body
---
plugins/redundant_attachments/redundant_attachments.php | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/redundant_attachments/redundant_attachments.php b/plugins/redundant_attachments/redundant_attachments.php
index c0affad..91a0275 100644
--- a/plugins/redundant_attachments/redundant_attachments.php
+++ b/plugins/redundant_attachments/redundant_attachments.php
@@ -126,11 +126,12 @@
$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);
--
Gitblit v1.9.1