* Fix RRULE parser (2nd part) - Bug#2991@egroupware.org

This commit is contained in:
Jörg Lehrke 2011-06-25 14:15:16 +00:00
parent 42e0b10797
commit 6b084b40f9

View File

@ -2506,14 +2506,11 @@ class calendar_ical extends calendar_boupdate
);
}
}
elseif (preg_match('/MD(\d+) (.*)/',$recurence, $recurenceMatches))
elseif (preg_match('/MD(\d+)(?: [^ ]+)? ([0-9T]+)/',$recurence, $recurenceMatches))
{
$vcardData['recur_type'] = MCAL_RECUR_MONTHLY_MDAY;
if ($recurenceMatches[1] > 1)
{
$vcardData['recur_interval'] = $recurenceMatches[1];
}
$vcardData['recur_enddate'] = $this->vCalendar->_parseDateTime(trim($recurenceMatches[2]));
$vcardData['recur_interval'] = $recurenceMatches[1];
$vcardData['recur_enddate'] = $this->vCalendar->_parseDateTime($recurenceMatches[2]);
}
elseif (preg_match('/MP(\d+) (.*) (.*) (.*)/',$recurence, $recurenceMatches))
{
@ -2555,7 +2552,7 @@ class calendar_ical extends calendar_boupdate
break;
case 'Y': // 1.0
if (preg_match('/YM(\d+)[^#]*#(\d+)/', $recurence, $recurenceMatches))
if (preg_match('/YM(\d+)(?: [^ ]+)? #(\d+)/', $recurence, $recurenceMatches))
{
$vcardData['recur_interval'] = $recurenceMatches[1];
if ($recurenceMatches[2] > 0 && $vcardData['end'])
@ -2570,18 +2567,10 @@ class calendar_ical extends calendar_boupdate
);
}
}
elseif (preg_match('/YM(\d+) (.*)/',$recurence, $recurenceMatches))
elseif (preg_match('/YM(\d+)(?: [^ ]+)? ([0-9T]+)/',$recurence, $recurenceMatches))
{
$vcardData['recur_interval'] = $recurenceMatches[1];
$enddate = trim($recurenceMatches[2]);
if ($enddate != '#0')
{
if (preg_match('/([\d,]+) (.*)/', $enddate, $fixMatches))
{
$enddate = trim($fixMatches[2]);
}
$vcardData['recur_enddate'] = $this->vCalendar->_parseDateTime($enddate);
}
$vcardData['recur_enddate'] = $this->vCalendar->_parseDateTime($recurenceMatches[2]);
} else break;
// fall-through