* Calendar/ImportExport: fixed out-of-memory condition while importing large iCal files

do NOT read whole file into memory, just pass stream so iCal class can use an iterator
This commit is contained in:
Ralf Becker 2013-03-14 15:40:05 +00:00
parent 4d11e020e8
commit 9ef5149632
2 changed files with 3 additions and 3 deletions

View File

@ -1058,7 +1058,7 @@ class calendar_ical extends calendar_boupdate
/** /**
* Import an iCal * Import an iCal
* *
* @param string $_vcalData * @param string|resource $_vcalData
* @param int $cal_id=-1 must be -1 for new entries! * @param int $cal_id=-1 must be -1 for new entries!
* @param string $etag=null if an etag is given, it has to match the current etag or the import will fail * @param string $etag=null if an etag is given, it has to match the current etag or the import will fail
* @param boolean $merge=false merge data with existing entry * @param boolean $merge=false merge data with existing entry

View File

@ -131,7 +131,7 @@ class calendar_import_ical implements importexport_iface_import_plugin {
echo lang("No preview for iCal"); echo lang("No preview for iCal");
return; return;
} }
if (!$calendar_ical->importVCal(stream_get_contents($_stream), -1,null,false,0,'',null,null,null,$_definition->plugin_options['no_notification'])) if (!$calendar_ical->importVCal($_stream, -1,null,false,0,'',null,null,null,$_definition->plugin_options['no_notification']))
{ {
$this->errors[] = lang('Error: importing the iCal'); $this->errors[] = lang('Error: importing the iCal');
} }