Patch from Jan

It is the simple patch to prevents the segfaulting of horde on ical with
spaces in the begin:vevent etc lines. (just \W\w replaced by \S if I
remember well at one place..)

The second patch is for getting rid of some php5 warnings when it
encounters the array_merge() in setParameter(). (only a simple cast to
an array).
This commit is contained in:
Lars Kneschke 2006-03-11 08:09:12 +00:00
parent e2988daef4
commit ea0f776b92

View File

@ -117,7 +117,7 @@ class Horde_iCalendar {
foreach ($keys as $key) { foreach ($keys as $key) {
if ($this->_attributes[$key]['name'] == $name) { if ($this->_attributes[$key]['name'] == $name) {
$this->_attributes[$key]['params'] = $this->_attributes[$key]['params'] =
array_merge($this->_attributes[$key]['params'] , $params); array_merge((array)$this->_attributes[$key]['params'] , $params);
return true; return true;
} }
} }
@ -419,7 +419,7 @@ class Horde_iCalendar {
// All subcomponents. // All subcomponents.
$matches = null; $matches = null;
if (preg_match_all('/BEGIN:([\W\w]*)(\r\n|\r|\n)([\W\w]*)END:\1(\r\n|\r|\n)/U', $vCal, $matches)) { if (preg_match_all('/BEGIN:([\S]*)(\r\n|\r|\n)([\W\w]*)END:\1(\r\n|\r|\n)/U', $vCal, $matches)) {
foreach ($matches[0] as $key => $data) { foreach ($matches[0] as $key => $data) {
$type = $matches[1][$key]; $type = $matches[1][$key];
$component = &Horde_iCalendar::newComponent(trim($type), $this); $component = &Horde_iCalendar::newComponent(trim($type), $this);