From b04943334a10427892ad78beb73114346ba89b88 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sun, 31 Oct 2010 17:03:05 +0100 Subject: [PATCH] multiple keys like exdate set in an array --- helpers/SG_iCal_Parser.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helpers/SG_iCal_Parser.php b/helpers/SG_iCal_Parser.php index 81f1a2a..2ddd99a 100755 --- a/helpers/SG_iCal_Parser.php +++ b/helpers/SG_iCal_Parser.php @@ -93,6 +93,7 @@ class SG_iCal_Parser { */ private static function _Parse( $content, SG_iCal $ical ) { $main_sections = array('vevent', 'vjournal', 'vtodo', 'vtimezone', 'vcalendar'); + $array_idents = array('exdate'); $sections = array(); $section = ''; $current_data = array(); @@ -120,11 +121,11 @@ class SG_iCal_Parser { // This section is in the main section if( $section == $s ) { // It _is_ the main section else - if ($line->getIdent() != "exdate") - $current_data[$s][$line->getIdent()] = $line; - else { + if (in_array($line->getIdent(), $array_idents)) //exdate could appears more that once $current_data[$s][$line->getIdent()][] = $line; + else { + $current_data[$s][$line->getIdent()] = $line; } } else { // Sub section