diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-11-23 09:41:10 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-11-23 09:41:10 +0100 |
commit | 2fce010f305a8c86581a51445529267e0bac11ad (patch) | |
tree | 3dbd4856ebeee5426dfb43fc0b1844e36c826023 /Zotlabs/Module | |
parent | 5ba8749a386f9d675aaf7746c322cb3a88d6dda0 (diff) | |
download | volse-hubzilla-2fce010f305a8c86581a51445529267e0bac11ad.tar.gz volse-hubzilla-2fce010f305a8c86581a51445529267e0bac11ad.tar.bz2 volse-hubzilla-2fce010f305a8c86581a51445529267e0bac11ad.zip |
whitespace cleanup
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 65d694b12..ed9f7ad06 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -96,31 +96,31 @@ class Wiki extends \Zotlabs\Web\Controller { // Download a wiki if ((argc() > 3) && (argv(2) === 'download') && (argv(3) === 'wiki')) { - $resource_id = argv(4); - $w = wiki_get_wiki($resource_id); - if (!$w['path']) { - notice(t('Error retrieving wiki') . EOL); - } - $zip_folder_name = random_string(10); - $zip_folderpath = '/tmp/' . $zip_folder_name; - if (!mkdir($zip_folderpath, 0770, false)) { - logger('Error creating zip file export folder: ' . $zip_folderpath, LOGGER_NORMAL); - notice(t('Error creating zip file export folder') . EOL); - } - $zip_filename = $w['urlName']; - $zip_filepath = '/tmp/' . $zip_folder_name . '/' . $zip_filename; - // Generate the zip file - \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"); - $success = readfile($zip_filepath); - if ($success) { - rrmdir($zip_folderpath); // delete temporary files - } else { - rrmdir($zip_folderpath); // delete temporary files - logger('Error downloading wiki: ' . $resource_id); - } + $resource_id = argv(4); + $w = wiki_get_wiki($resource_id); + if (!$w['path']) { + notice(t('Error retrieving wiki') . EOL); + } + $zip_folder_name = random_string(10); + $zip_folderpath = '/tmp/' . $zip_folder_name; + if (!mkdir($zip_folderpath, 0770, false)) { + logger('Error creating zip file export folder: ' . $zip_folderpath, LOGGER_NORMAL); + notice(t('Error creating zip file export folder') . EOL); + } + $zip_filename = $w['urlName']; + $zip_filepath = '/tmp/' . $zip_folder_name . '/' . $zip_filename; + // Generate the zip file + \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"); + $success = readfile($zip_filepath); + if ($success) { + rrmdir($zip_folderpath); // delete temporary files + } else { + rrmdir($zip_folderpath); // delete temporary files + logger('Error downloading wiki: ' . $resource_id); + } } switch (argc()) { |