diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-09-29 14:28:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-09-29 14:28:57 +0200 |
commit | 2086bc4be77ba64337b721cec1cac544c1c58452 (patch) | |
tree | 1ce50e6854664b8e8dcf2b741551cd417de88fdd /3rdparty/Sabre/CardDAV | |
parent | fcc6d61fe195e090da33f213312d3d8bec8c1c71 (diff) | |
download | nextcloud-server-2086bc4be77ba64337b721cec1cac544c1c58452.tar.gz nextcloud-server-2086bc4be77ba64337b721cec1cac544c1c58452.zip |
update sabredav to 1.5.3
Diffstat (limited to '3rdparty/Sabre/CardDAV')
-rw-r--r-- | 3rdparty/Sabre/CardDAV/AddressBook.php | 2 | ||||
-rw-r--r-- | 3rdparty/Sabre/CardDAV/Backend/PDO.php | 4 | ||||
-rw-r--r-- | 3rdparty/Sabre/CardDAV/Card.php | 3 | ||||
-rw-r--r-- | 3rdparty/Sabre/CardDAV/Plugin.php | 3 | ||||
-rw-r--r-- | 3rdparty/Sabre/CardDAV/Property/SupportedAddressData.php | 69 | ||||
-rw-r--r-- | 3rdparty/Sabre/CardDAV/Version.php | 4 |
6 files changed, 81 insertions, 4 deletions
diff --git a/3rdparty/Sabre/CardDAV/AddressBook.php b/3rdparty/Sabre/CardDAV/AddressBook.php index 04e4c227b86..3333480ea85 100644 --- a/3rdparty/Sabre/CardDAV/AddressBook.php +++ b/3rdparty/Sabre/CardDAV/AddressBook.php @@ -112,6 +112,8 @@ class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_Ca public function createFile($name,$vcardData = null) { $vcardData = stream_get_contents($vcardData); + // Converting to UTF-8, if needed + $vcardData = Sabre_DAV_StringUtil::ensureUTF8($vcardData); $this->carddavBackend->createCard($this->addressBookInfo['id'],$name,$vcardData); diff --git a/3rdparty/Sabre/CardDAV/Backend/PDO.php b/3rdparty/Sabre/CardDAV/Backend/PDO.php index 63a74745aac..5556d0a7648 100644 --- a/3rdparty/Sabre/CardDAV/Backend/PDO.php +++ b/3rdparty/Sabre/CardDAV/Backend/PDO.php @@ -66,7 +66,9 @@ class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract { 'principaluri' => $row['principaluri'], '{DAV:}displayname' => $row['displayname'], '{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], - '{http://calendarserver.org/ns/}getctag' => $row['ctag'], + '{http://calendarserver.org/ns/}getctag' => $row['ctag'], + '{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}supported-address-data' => + new Sabre_CardDAV_Property_SupportedAddressData(), ); } diff --git a/3rdparty/Sabre/CardDAV/Card.php b/3rdparty/Sabre/CardDAV/Card.php index 52d8b79d7dd..5298d31e245 100644 --- a/3rdparty/Sabre/CardDAV/Card.php +++ b/3rdparty/Sabre/CardDAV/Card.php @@ -88,6 +88,9 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard, if (is_resource($cardData)) $cardData = stream_get_contents($cardData); + // Converting to UTF-8, if needed + $cardData = Sabre_DAV_StringUtil::ensureUTF8($cardData); + $this->carddavBackend->updateCard($this->addressBookInfo['id'],$this->cardData['uri'],$cardData); $this->cardData['carddata'] = $cardData; diff --git a/3rdparty/Sabre/CardDAV/Plugin.php b/3rdparty/Sabre/CardDAV/Plugin.php index a96f9aaebb6..17766b78278 100644 --- a/3rdparty/Sabre/CardDAV/Plugin.php +++ b/3rdparty/Sabre/CardDAV/Plugin.php @@ -95,9 +95,10 @@ class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin { public function getSupportedReportSet($uri) { $node = $this->server->tree->getNodeForPath($uri); - if ($node instanceof Sabre_CardDAV_AddressBook || $node instanceof Sabre_CardDAV_ICard) { + if ($node instanceof Sabre_CardDAV_IAddressBook || $node instanceof Sabre_CardDAV_ICard) { return array( '{' . self::NS_CARDDAV . '}addressbook-multiget', + '{' . self::NS_CARDDAV . '}addressbook-query', ); } return array(); diff --git a/3rdparty/Sabre/CardDAV/Property/SupportedAddressData.php b/3rdparty/Sabre/CardDAV/Property/SupportedAddressData.php new file mode 100644 index 00000000000..d57d3a6e7bd --- /dev/null +++ b/3rdparty/Sabre/CardDAV/Property/SupportedAddressData.php @@ -0,0 +1,69 @@ +<?php + +/** + * Supported-address-data property + * + * This property is a representation of the supported-address-data property + * in the CardDAV namespace. + * + * @package Sabre + * @subpackage CardDAV + * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved. + * @author Evert Pot (http://www.rooftopsolutions.nl/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class Sabre_CardDAV_Property_SupportedAddressData extends Sabre_DAV_Property { + + /** + * supported versions + * + * @var array + */ + protected $supportedData = array(); + + /** + * Creates the property + * + * @param array $components + */ + public function __construct(array $supportedData = null) { + + if (is_null($supportedData)) { + $supportedData = array( + array('contentType' => 'text/vcard', 'version' => '3.0'), + array('contentType' => 'text/vcard', 'version' => '4.0'), + ); + } + + $this->supportedData = $supportedData; + + } + + /** + * Serializes the property in a DOMDocument + * + * @param Sabre_DAV_Server $server + * @param DOMElement $node + * @return void + */ + public function serialize(Sabre_DAV_Server $server,DOMElement $node) { + + $doc = $node->ownerDocument; + + $prefix = + isset($server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV]) ? + $server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV] : + 'card'; + + foreach($this->supportedData as $supported) { + + $caldata = $doc->createElementNS(Sabre_CardDAV_Plugin::NS_CARDDAV, $prefix . ':address-data-type'); + $caldata->setAttribute('content-type',$supported['contentType']); + $caldata->setAttribute('version',$supported['version']); + $node->appendChild($caldata); + + } + + } + +} diff --git a/3rdparty/Sabre/CardDAV/Version.php b/3rdparty/Sabre/CardDAV/Version.php index 8961027fc89..c76ee360354 100644 --- a/3rdparty/Sabre/CardDAV/Version.php +++ b/3rdparty/Sabre/CardDAV/Version.php @@ -18,11 +18,11 @@ class Sabre_CardDAV_Version { /** * Full version number */ - const VERSION = '0.2'; + const VERSION = '1.5.3'; /** * Stability : alpha, beta, stable */ - const STABILITY = 'alpha'; + const STABILITY = 'stable'; } |