Skip to content
Snippets Groups Projects
Commit 99d17c51 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Don't add empty property parameters.

parent 1df596e7
Branches
No related tags found
No related merge requests found
......@@ -141,11 +141,15 @@ foreach ($parameters as $key=>$element) {
// And it probably shouldn't be done here anyways :-/
foreach($element as $e) {
if($e != '' && !is_null($e)) {
$vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key, $e);
if(trim($e)) {
$vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key, $e);
}
}
}
} else {
if(trim($element)) {
$vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key, $element);
}
}
}
$checksum = md5($vcard->children[$line]->serialize());
......
......@@ -133,17 +133,21 @@ if(!$value) {
debug('Adding parameter: '.$key);
if(is_array($parameter)) {
foreach($parameter as $val) {
debug('Adding parameter: '.$key.'=>'.$val);
if(trim($val)) {
debug('Adding parameter: '.$key.'=>'.$val);
$vcard->children[$line]->add(new Sabre_VObject_Parameter(
$key,
strtoupper(strip_tags($val)))
);
}
}
} else {
if(trim($parameter)) {
$vcard->children[$line]->add(new Sabre_VObject_Parameter(
$key,
strtoupper(strip_tags($val)))
strtoupper(strip_tags($parameter)))
);
}
} else {
$vcard->children[$line]->add(new Sabre_VObject_Parameter(
$key,
strtoupper(strip_tags($parameter)))
);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment