From a6f1bdd5f14206dad58563259956ac6889d21a6c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 Jan 2006 08:47:24 +0000 Subject: [PATCH] r727: Only get the file data if we don't have errors... saves memory --- attachment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/attachment.php b/attachment.php index 77b2270..472fd07 100755 --- a/attachment.php +++ b/attachment.php @@ -80,13 +80,13 @@ if ($_POST['do'] == 'insert') { $message->items[] = $lang->string('The file you specified exceeds MySQL\'s maximum allowed packet.'); } - - $filedata = $bugsys->escape(file_get_contents($FILE['tmp_name']), true, true); - $time = TIMENOW; - + // insert an attachment if (!$message->items) { + $filedata = $bugsys->escape(file_get_contents($FILE['tmp_name']), true, true); + $time = TIMENOW; + $db->query(" INSERT INTO " . TABLE_PREFIX . "attachment (bugid, filename, mimetype, filesize, -- 2.43.5