diff options
author | Andrew Dolgov <[email protected]> | 2019-08-14 13:57:31 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-14 13:57:31 +0300 |
commit | 6953ca02fd5df11d3ef59cf0b4049a5b329f655b (patch) | |
tree | 0e83f050ea6eeb20990be3f659143fe0003a56fd | |
parent | 1f1bd315e1a770a380aca694b6b067bdef469207 (diff) |
* check whether ZIP operation completed successfully on close because ZipArchive will happily write into a nonexistent archive with no errors
* add .zip extension to output file if not present
-rw-r--r-- | init.php | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -110,6 +110,9 @@ class Data_Migration extends Plugin { if ($row = $sth->fetch()) { $owner_uid = $row['id']; + if (stripos($output_file, ".zip") === FALSE) + $output_file = $output_file . ".zip"; + Debug::log("exporting articles of user $user to $output_file..."); if ($only_marked) @@ -151,7 +154,10 @@ class Data_Migration extends Plugin { break; } - $zip->close(); + if ($zip->close() !== TRUE) { + Debug::log("write error while saving data to $output_file"); + exit(3); + } Debug::log("exported $total_processed articles to $output_file."); |