summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-04-02 16:36:09 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-04-02 16:56:42 (GMT)
commit174a889771c9f54146f23862b548ebc357f9e7e1 (patch)
tree92b88d355c8371226f1d459abd04a775c72ad376
parent2069f1fbc9eb7ede89d9873d1e70f8f92b497f9e (diff)
downloadiRony-174a889771c9f54146f23862b548ebc357f9e7e1.tar.gz
Minor fixes after rebase and library updates
-rw-r--r--composer.json4
-rw-r--r--lib/Kolab/CardDAV/Plugin.php2
-rw-r--r--lib/Kolab/Utils/VObjectUtils.php11
3 files changed, 11 insertions, 6 deletions
diff --git a/composer.json b/composer.json
index 25546d2..e612d8b 100644
--- a/composer.json
+++ b/composer.json
@@ -15,11 +15,11 @@
],
"require": {
"php": ">=5.4.1",
- "sabre/dav" : "~2.1.0"
+ "sabre/dav" : "2.1.*"
},
"require-dev": {
"pear/mail_mime": ">=1.8.9",
- "pear/mail_mime-decode": ">=1.5.5",
+ "pear/mail_mime-decode": "~1.5.5",
"pear-pear.php.net/net_idna2": ">=0.1.1",
"pear-pear.php.net/net_ldap2": ">=2.0.12",
"kolab/Net_LDAP3": "dev-master"
diff --git a/lib/Kolab/CardDAV/Plugin.php b/lib/Kolab/CardDAV/Plugin.php
index f579e45..053fee0 100644
--- a/lib/Kolab/CardDAV/Plugin.php
+++ b/lib/Kolab/CardDAV/Plugin.php
@@ -153,7 +153,7 @@ class Plugin extends CardDAV\Plugin
protected function convertVCard($data, $target)
{
$version = 'vcard3';
- if (preg_match('/VERSION:(\d)/', $data, $m)) {
+ if (is_string($data) && preg_match('/VERSION:(\d)/', $data, $m)) {
$version = 'vcard' . $m[1];
}
diff --git a/lib/Kolab/Utils/VObjectUtils.php b/lib/Kolab/Utils/VObjectUtils.php
index 9131597..7dbcb06 100644
--- a/lib/Kolab/Utils/VObjectUtils.php
+++ b/lib/Kolab/Utils/VObjectUtils.php
@@ -67,13 +67,18 @@ class VObjectUtils
$dt->setTimeZone(new \DateTimeZone('UTC'));
}
- $vdt = $root->createProperty($name);
- $vdt->setValue($dt);
+ $vdt = $root->createProperty($name, null, null, $dt->_dateonly ? 'DATE' : 'DATE-TIME');
+ $value = $dt;
if ($dt->_dateonly) {
- $vdt['VALUE'] = 'DATE';
+ // $vdt['VALUE'] = 'DATE';
+ // set date value as string as a temporary fix for
+ // https://github.com/fruux/sabre-vobject/issues/217
+ $value = $dt->format('Y-m-d');
}
+ $vdt->setVAlue($value);
+
return $vdt;
}