Fix vCard-parser for multible type parameters

This commit is contained in:
Jörg Lehrke 2010-10-29 08:40:48 +00:00
parent f10e3a6ff3
commit 7c61ffa833

View File

@ -641,11 +641,20 @@ class Horde_iCalendar {
$paramValue = $param_parts[4][$key];
if ($paramName == 'TYPE') {
$paramValue = preg_split('/(?<!\\\\),/', $paramValue);
if (count($paramValue) == 1) {
$paramValue = $paramValue[0];
}
if (isset($params[$paramName])) {
if (!is_array($params[$paramName])) {
$params[$paramName] = array($params[$paramName]);
}
$params[$paramName] = array_merge($params[$paramName], $paramValue);
} else {
if (count($paramValue) == 1) {
$paramValue = $paramValue[0];
}
$params[$paramName] = $paramValue;
}
} else {
$params[$paramName] = $paramValue;
}
$params[$paramName] = $paramValue;
}
}