Skip to content

Commit 15e680e

Browse files
committed
Automatically converting incoming vcard or icalendardata to UTF-8.
1 parent bcc0003 commit 15e680e

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
uppercase.
55
* Fixed: Issue 153: Support for files with mixed newline styles in
66
Sabre_VObject.
7+
* Fixed: Issue 159: Automatically converting any vcard and icalendardata
8+
to UTF-8.
79
* Added: Sabre_DAV_SimpleFile class for easy static file creation.
810
* Added: Issue 158: Support for the CARDDAV:supported-address-data
911
property.

lib/Sabre/CalDAV/Calendar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ public function createDirectory($name) {
178178
public function createFile($name,$calendarData = null) {
179179

180180
$calendarData = stream_get_contents($calendarData);
181+
// Converting to UTF-8, if needed
182+
$calendarData = Sabre_DAV_StringUtil::ensureUTF8($calendarData);
181183

182184
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
183185
if ($supportedComponents) {

lib/Sabre/CalDAV/CalendarObject.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public function put($calendarData) {
9393
if (is_resource($calendarData))
9494
$calendarData = stream_get_contents($calendarData);
9595

96+
// Converting to UTF-8, if needed
97+
$calendarData = Sabre_DAV_StringUtil::ensureUTF8($calendarData);
98+
9699
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
97100
if ($supportedComponents) {
98101
$supportedComponents = $supportedComponents->getValue();

lib/Sabre/CalDAV/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Sabre_CalDAV_Version {
1414
/**
1515
* Full version number
1616
*/
17-
const VERSION = '1.5.2';
17+
const VERSION = '1.5.3';
1818

1919
/**
2020
* Stability : alpha, beta, stable

lib/Sabre/CardDAV/AddressBook.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public function createDirectory($name) {
112112
public function createFile($name,$vcardData = null) {
113113

114114
$vcardData = stream_get_contents($vcardData);
115+
// Converting to UTF-8, if needed
116+
$vcardData = Sabre_DAV_StringUtil::ensureUTF8($vcardData);
115117

116118
$this->carddavBackend->createCard($this->addressBookInfo['id'],$name,$vcardData);
117119

lib/Sabre/CardDAV/Card.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public function put($cardData) {
8888
if (is_resource($cardData))
8989
$cardData = stream_get_contents($cardData);
9090

91+
// Converting to UTF-8, if needed
92+
$cardData = Sabre_DAV_StringUtil::ensureUTF8($cardData);
93+
9194
$this->carddavBackend->updateCard($this->addressBookInfo['id'],$this->cardData['uri'],$cardData);
9295
$this->cardData['carddata'] = $cardData;
9396

0 commit comments

Comments
 (0)