From 1e22e9a8a167b439bfef5eae8272c28636161858 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 25 Sep 2010 17:17:06 +1200 Subject: [PATCH] Provide correct getcontenttype property for addressbook resources. --- inc/DAVResource.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 2f0624e6..82b117f7 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -259,7 +259,12 @@ class DAVResource else { $this->resourcetypes = ''; if ( isset($this->resource->caldav_data) ) { - if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) $this->contenttype = 'text/calendar'; + if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) { + $this->contenttype = 'text/calendar'; + } + else if ( isset($this->resource->fn) ) { + $this->contenttype = 'text/vcard'; + } $this->resource->displayname = $this->resource->summary; } } @@ -523,6 +528,9 @@ EOQRY; if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) { $this->contenttype = 'text/calendar'; } + else if ( isset($this->resource->fn) ) { + $this->contenttype = 'text/vcard'; + } $this->resourcetypes = ''; } else {