From f76046b6120aec97f96eef8e83b603cc0a54438e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 23 Nov 2016 10:28:37 +0100 Subject: silence headers already sent warning. issue #596 --- Zotlabs/Module/Wiki.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Module/Wiki.php') diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 53c267a93..a73364b06 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -118,18 +118,21 @@ class Wiki extends \Zotlabs\Web\Controller { \Zotlabs\Lib\ExtendedZip::zipTree($w['path'], $zip_filepath, \ZipArchive::CREATE); // Output the file for download + header('Content-disposition: attachment; filename="' . $zip_filename . '.zip"'); - header("Content-Type: application/zip"); + header('Content-Type: application/zip'); $success = readfile($zip_filepath); - if($success) { - rrmdir($zip_folderpath); // delete temporary files - } - else { - rrmdir($zip_folderpath); // delete temporary files + if(!$success) { logger('Error downloading wiki: ' . $resource_id); + notice(t('Error downloading wiki: ' . $resource_id) . EOL); } + + // delete temporary files + rrmdir($zip_folderpath); + killme(); + } switch (argc()) { -- cgit v1.2.3