Fix vCard-parser for multible type parameters

This commit is contained in:
Jörg Lehrke 2010-10-29 08:40:02 +00:00
parent 0b4c7f3ef6
commit ac015ec983

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;
}
}