From 63c4de9f34d9128d6405bedde82e9e1316d91cd1 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Sat, 29 Apr 2017 00:31:09 +0200 Subject: [PATCH] do not advertise ?add_member on a principal We wouldn't know what to do with that anyway... Fixes the CalDAV/add-member.xml test. --- inc/DAVResource.php | 1 + testing/tests/regression-suite/0548-iCal-PROPFIND.result | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/inc/DAVResource.php b/inc/DAVResource.php index aa84eb1c..67d786cb 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -1656,6 +1656,7 @@ EOQRY; case 'DAV::add-member': if ( ! $this->_is_collection ) return false; + if ( $this->_is_principal ) return false; if ( isset($c->post_add_member) && $c->post_add_member === false ) return false; $reply->DAVElement( $prop, 'add-member', $reply->href(ConstructURL(DeconstructURL($this->url())).'?add_member') ); break; diff --git a/testing/tests/regression-suite/0548-iCal-PROPFIND.result b/testing/tests/regression-suite/0548-iCal-PROPFIND.result index e8414e50..0a554289 100644 --- a/testing/tests/regression-suite/0548-iCal-PROPFIND.result +++ b/testing/tests/regression-suite/0548-iCal-PROPFIND.result @@ -4,8 +4,8 @@ HTTP/1.1 207 Multi-Status Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy -ETag: "803271349e94513fdc607adc2fc2df6f" -Content-Length: 27776 +ETag: "d148cedddc356b211c308738c99d6888" +Content-Length: 27711 Content-Type: text/xml; charset="utf-8" @@ -14,9 +14,6 @@ Content-Type: text/xml; charset="utf-8" /caldav.php/user1/ - - /caldav.php/user1/?add_member - @@ -94,6 +91,7 @@ Content-Type: text/xml; charset="utf-8" +