aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-11-10 11:37:07 +0100
committerArthur Schiwon <blizzz@owncloud.com>2015-11-10 11:41:27 +0100
commit06d1685e75f88a2423c3bcdc71b79c95c806347c (patch)
tree7e6d9fb315663588999607dddcd5d017aead29e5 /apps/dav/lib
parentbdd396aa3d710de1ea26f9279610392e6edaffc2 (diff)
downloadnextcloud-server-06d1685e75f88a2423c3bcdc71b79c95c806347c.tar.gz
nextcloud-server-06d1685e75f88a2423c3bcdc71b79c95c806347c.zip
When creating addressbooks, make sure the displayname is set
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/carddav/carddavbackend.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php
index 7b16262a680..b2597baedc6 100644
--- a/apps/dav/lib/carddav/carddavbackend.php
+++ b/apps/dav/lib/carddav/carddavbackend.php
@@ -134,7 +134,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @param string $principalUri
* @param string $url Just the 'basename' of the url.
* @param array $properties
- * @return void
+ * @throws BadRequest
*/
function createAddressBook($principalUri, $url, array $properties) {
$values = [
@@ -160,6 +160,12 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
+ // Fallback to make sure the displayname is set. Some clients may refuse
+ // to work with addressbooks not having a displayname.
+ if(is_null($values['displayname'])) {
+ $values['displayname'] = $url;
+ }
+
$query = $this->db->getQueryBuilder();
$query->insert('addressbooks')
->values([