mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-18 13:24:37 -04:00
Improve system import/export
Miss checking presence of zip extension during import See https://github.com/marienfressinaud/FreshRSS/issues/494
This commit is contained in:
@@ -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']
|
||||
|
||||
@@ -182,7 +182,9 @@ return array (
|
||||
'focus_search' => 'Access search box',
|
||||
|
||||
'file_to_import' => 'File to import<br />(OPML, Json or Zip)',
|
||||
'file_to_import_no_zip' => 'File to import<br />(OPML or Json)',
|
||||
'import' => 'Import',
|
||||
'no_zip_extension' => 'Zip extension is not present on your server.',
|
||||
'export' => 'Export',
|
||||
'export_opml' => 'Export list of feeds (OPML)',
|
||||
'export_starred' => 'Export your favourites',
|
||||
|
||||
@@ -182,7 +182,9 @@ return array (
|
||||
'focus_search' => 'Accéder à la recherche',
|
||||
|
||||
'file_to_import' => 'Fichier à importer<br />(OPML, Json ou Zip)',
|
||||
'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou Json)',
|
||||
'import' => 'Importer',
|
||||
'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.',
|
||||
'export' => 'Exporter',
|
||||
'export_opml' => 'Exporter la liste des flux (OPML)',
|
||||
'export_starred' => 'Exporter les favoris',
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
<form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data">
|
||||
<legend><?php echo _t('import'); ?></legend>
|
||||
<div class="form-group">
|
||||
<label class="group-name" for="file"><?php echo _t('file_to_import'); ?></label>
|
||||
<label class="group-name" for="file">
|
||||
<?php echo extension_loaded('zip') ? _t('file_to_import') : _t('file_to_import_no_zip'); ?>
|
||||
</label>
|
||||
<div class="group-controls">
|
||||
<input type="file" name="file" id="file" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user