Skip to content

Commit

Permalink
Merge pull request Z-Hub#100 from matidau/radicale-addressbook-vcard-…
Browse files Browse the repository at this point in the history
…content-type

Radicale ignore vcard getcontenttype if Address Book collection
  • Loading branch information
matidau authored Aug 19, 2024
2 parents 94270c5 + 374bbe0 commit 6575263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/include/z_carddav.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,10 @@ private function simplify($response, $include_vcards = true, $remove_duplicates

foreach ($xml->response as $response) {
if (isset($response->propstat)) {
if ((strlen($this->url_vcard_extension) > 0 && preg_match('/'.$this->url_vcard_extension.'/', $response->href) &&
if ((((strlen($this->url_vcard_extension) > 0 && preg_match('/'.$this->url_vcard_extension.'/', $response->href))
|| preg_match('/vcard/', $response->propstat->prop->getcontenttype)) &&
!(isset($response->propstat->prop->resourcetype) && isset($response->propstat->prop->resourcetype->addressbook)))
|| preg_match('/vcard/', $response->propstat->prop->getcontenttype) || isset($response->propstat->prop->{'address-data'}) || isset($response->propstat->prop->{'addressbook-data'})) {
|| isset($response->propstat->prop->{'address-data'}) || isset($response->propstat->prop->{'addressbook-data'})) {
// It's a vcard
$id = basename($response->href);
$id = str_replace($this->url_vcard_extension, null, $id);
Expand Down

0 comments on commit 6575263

Please sign in to comment.