diff options
| author | 2014-08-11 19:02:27 +0200 | |
|---|---|---|
| committer | 2014-08-11 19:02:27 +0200 | |
| commit | 94570aaf5a23dfc02bf1120d168ec30c2ab3f044 (patch) | |
| tree | 7349e8c938792d7cf26515f9fa237f2685f95085 /app/Controllers/importExportController.php | |
| parent | bc71a577fe3154080df9949b394c7ae552773c7b (diff) | |
Improve system import/export
Miss checking presence of zip extension during import
See https://github.com/marienfressinaud/FreshRSS/issues/494
Diffstat (limited to 'app/Controllers/importExportController.php')
| -rw-r--r-- | app/Controllers/importExportController.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 2b3353d93..dd6c23322 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -39,7 +39,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // We try to list all files according to their type // A zip file is first opened and then its files are listed $list = array(); - if ($type_file === 'zip') { + if ($type_file === 'zip' && extension_loaded('zip')) { $zip = zip_open($file['tmp_name']); while (($zipfile = zip_read($zip)) !== false) { @@ -56,6 +56,14 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } zip_close($zip); + } elseif ($type_file === 'zip') { + // Zip extension is not loaded + Minz_Session::_param('notification', array( + 'type' => 'bad', + 'content' => _t('no_zip_extension') + )); + + Minz_Request::forward(array('c' => 'importExport'), true); } elseif ($type_file !== 'unknown') { $list_files[$type_file][] = file_get_contents( $file['tmp_name'] |
