From 430087e5338f488b79d8ca8a3d8f98ee847ace61 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 15 Nov 2015 12:05:36 -0500 Subject: [PATCH] #405 Fallback to ticket attachments folder for legacy KB attachments --- download_attachment.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/download_attachment.php b/download_attachment.php index e3ffe949..59ec5758 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -127,7 +127,12 @@ if (isset($_GET['kb_att'])) { // Perhaps the file has been deleted? if (!file_exists($realpath)) { - hesk_error($hesklang['attdel']); + // Let's try the ticket attachment folder. Legacy KB attachments are not automatically migrated. + $realpath = $hesk_settings['attach_dir'] . '/' . $file['saved_name']; + + if (!file_exists($realpath)) { + hesk_error($hesklang['attdel']); + } } // Update the download count @@ -161,5 +166,4 @@ if ($file['size'] > $chunksize) { readfile($realpath); } -exit(); -?> +exit(); \ No newline at end of file