From 9ef5149632a37ab245a6a54693479d8e22dfc7c1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Mar 2013 15:40:05 +0000 Subject: [PATCH] * 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 --- calendar/inc/class.calendar_ical.inc.php | 2 +- calendar/inc/class.calendar_import_ical.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 008a686ab5..3d9944d38f 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -1058,7 +1058,7 @@ class calendar_ical extends calendar_boupdate /** * Import an iCal * - * @param string $_vcalData + * @param string|resource $_vcalData * @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 boolean $merge=false merge data with existing entry diff --git a/calendar/inc/class.calendar_import_ical.inc.php b/calendar/inc/class.calendar_import_ical.inc.php index 55d17e0d0a..ed9ee8924a 100644 --- a/calendar/inc/class.calendar_import_ical.inc.php +++ b/calendar/inc/class.calendar_import_ical.inc.php @@ -131,7 +131,7 @@ class calendar_import_ical implements importexport_iface_import_plugin { echo lang("No preview for iCal"); 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'); } @@ -143,7 +143,7 @@ class calendar_import_ical implements importexport_iface_import_plugin { return $calendar_ical->events_imported; } - + /** * returns translated name of plugin *