summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/CardDAV/Card.php
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/Sabre/CardDAV/Card.php')
-rw-r--r--[-rwxr-xr-x]3rdparty/Sabre/CardDAV/Card.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/3rdparty/Sabre/CardDAV/Card.php b/3rdparty/Sabre/CardDAV/Card.php
index d7c66333837..0e35d321eb8 100755..100644
--- a/3rdparty/Sabre/CardDAV/Card.php
+++ b/3rdparty/Sabre/CardDAV/Card.php
@@ -6,7 +6,7 @@
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard, Sabre_DAVACL_IACL {
@@ -78,7 +78,7 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
* Updates the VCard-formatted object
*
* @param string $cardData
- * @return void
+ * @return string|null
*/
public function put($cardData) {
@@ -114,7 +114,7 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
*/
public function getContentType() {
- return 'text/x-vcard';
+ return 'text/x-vcard; charset=utf-8';
}
@@ -128,7 +128,13 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
if (isset($this->cardData['etag'])) {
return $this->cardData['etag'];
} else {
- return '"' . md5($this->get()) . '"';
+ $data = $this->get();
+ if (is_string($data)) {
+ return '"' . md5($data) . '"';
+ } else {
+ // We refuse to calculate the md5 if it's a stream.
+ return null;
+ }
}
}
@@ -136,7 +142,7 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
/**
* Returns the last modification date as a unix timestamp
*
- * @return time
+ * @return int
*/
public function getLastModified() {