Contacts: Hack around malformed BDAY.

This commit is contained in:
Thomas Tanghus 2012-05-04 01:27:59 +02:00
parent bde5b4a7ff
commit e61e40c23d

View file

@ -475,9 +475,15 @@ class OC_Contacts_VCard{
//$value = htmlspecialchars($value);
if($property->name == 'ADR' || $property->name == 'N'){
$value = self::unescapeDelimiters($value);
}/* elseif($property->name == 'CATEGORIES') {
$value = self::unescapeDelimiters($value, ',');
}*/
} elseif($property->name == 'BDAY') {
if(strpos($value, '-') === false) {
if(strlen($value) >= 8) {
$value = substr($value, 0, 4).'-'.substr($value, 4, 2).'-'.substr($value, 6, 2);
} else {
return null; // Badly malformed :-(
}
}
}
$temp = array(
'name' => $property->name,
'value' => $value,