diff options
author | Susinthiran Sithamparanathan <chesusin@gmail.com> | 2012-10-17 12:25:34 +0200 |
---|---|---|
committer | Susinthiran Sithamparanathan <chesusin@gmail.com> | 2012-10-17 16:17:36 +0200 |
commit | b2b84f3a6f3c98005f80c6c7c558a33b4ea36193 (patch) | |
tree | 1ae0c571e25ab7322e9a942dfdcc593f67e98ad6 /3rdparty/Sabre/CardDAV/Card.php | |
parent | 45dec77d92c9a7804489bee34b218bbe8c85f7c5 (diff) | |
download | nextcloud-server-b2b84f3a6f3c98005f80c6c7c558a33b4ea36193.tar.gz nextcloud-server-b2b84f3a6f3c98005f80c6c7c558a33b4ea36193.zip |
Update Sabre to version 1.7.1
Diffstat (limited to '3rdparty/Sabre/CardDAV/Card.php')
-rw-r--r--[-rwxr-xr-x] | 3rdparty/Sabre/CardDAV/Card.php | 16 |
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() { |