Skip to content

Commit 6807bcc

Browse files
committed
Merge branch 'master' of github.com:fruux/sabre-dav
2 parents 2713b91 + bf5363a commit 6807bcc

26 files changed

+223
-116
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ tests/temp
33
tests/.sabredav
44
tests/cov
55

6+
# Custom settings for tests
7+
tests/config.user.php
8+
69
# ViM
710
*.swp
811

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
ChangeLog
22
=========
33

4-
3.1.0-alpha3 (2015-??-??)
5-
-------------------------
4+
3.1.1 (????-??-??)
5+
------------------
6+
7+
* #755: The brower plugin and some operations would break when scheduling and
8+
delegation would both be enabled.
9+
10+
11+
3.1.0 (2016-01-06)
12+
------------------
613

714
* Better error message when the browser plugin is not enabled.
815
* Added a super minimal server example.
@@ -13,7 +20,6 @@ ChangeLog
1320
* #729: Not all calls to `Sabre\DAV\Tree::getChildren()` were properly cached.
1421
* #727: Added another workaround to make CalDAV work for Windows 10 clients.
1522
* #742: Fixes to make sure that vobject 4 is correctly supported.
16-
* Subtle browser improvements.
1723
* #726: Better error reporting in `Client::propPatch`. We're now throwing
1824
exceptions.
1925
* #608: When a HTTP error is triggered during `Client:propFind`, we're now
@@ -26,6 +32,10 @@ ChangeLog
2632
* #686: Corrected PDO principal backend's findByURI for email addresses that
2733
don't match the exact capitalization.
2834
* #512: The client now has it's own `User-Agent`.
35+
* #720: Some browser improvements.
36+
* The zip release ships with [sabre/vobject 4.0.1][vobj],
37+
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
38+
[sabre/uri 1.0.1][uri] and [sabre/xml 1.3.0][xml].
2939

3040

3141
3.1.0-alpha2 (2015-09-05)
@@ -61,6 +71,12 @@ ChangeLog
6171
[sabre/uri 1.0.1][uri] and [sabre/xml 1.1.0][xml].
6272

6373

74+
3.0.7 (????-??-??)
75+
------------------
76+
77+
* #752: PHP 7 support for 3.0 branch. (@DeepDiver1975)
78+
79+
6480
3.0.6 (2016-01-04)
6581
------------------
6682

@@ -2133,8 +2149,9 @@ ChangeLog
21332149

21342150
* First release!
21352151
* Passes litmus: basic, http and copymove test.
2136-
* Fully working in Finder and DavFSv2 Project started: 2007-12-13
2152+
* Fully working in Finder and DavFS2.
21372153

2154+
Project started: 2007-12-13
21382155

21392156
[vobj]: http://sabre.io/vobject/
21402157
[evnt]: http://sabre.io/event/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"sabre/vobject": "~4.0",
1919
"sabre/event" : ">=2.0.0, <4.0.0",
2020
"sabre/xml" : "~1.0",
21-
"sabre/http" : "dev-master",
21+
"sabre/http" : "^4.2.1",
2222
"sabre/uri" : "~1.0",
2323
"ext-dom": "*",
2424
"ext-pcre": "*",

lib/CalDAV/Plugin.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,26 @@ function getHTTPMethods($uri) {
8989
* Returns the path to a principal's calendar home.
9090
*
9191
* The return url must not end with a slash.
92+
* This function should return null in case a principal did not have
93+
* a calendar home.
9294
*
9395
* @param string $principalUrl
9496
* @return string
9597
*/
9698
function getCalendarHomeForPrincipal($principalUrl) {
9799

98-
// The default is a bit naive, but it can be overwritten.
99-
list(, $nodeName) = Uri\split($principalUrl);
100+
// The default behavior for most sabre/dav servers is that there is a
101+
// principals root node, which contains users directly under it.
102+
//
103+
// This function assumes that there are two components in a principal
104+
// path. If there's more, we don't return a calendar home. This
105+
// excludes things like the calendar-proxy-read principal (which it
106+
// should).
107+
$parts = explode('/', trim($principalUrl, '/'));
108+
if (count($parts) !== 2) return;
109+
if ($parts[0] !== 'principals') return;
100110

101-
return self::CALENDAR_ROOT . '/' . $nodeName;
111+
return self::CALENDAR_ROOT . '/' . $parts[1];
102112

103113
}
104114

@@ -329,8 +339,9 @@ function propFind(DAV\PropFind $propFind, DAV\INode $node) {
329339

330340
$propFind->handle('{' . self::NS_CALDAV . '}calendar-home-set', function() use ($principalUrl) {
331341

332-
$calendarHomePath = $this->getCalendarHomeForPrincipal($principalUrl) . '/';
333-
return new Href($calendarHomePath);
342+
$calendarHomePath = $this->getCalendarHomeForPrincipal($principalUrl);
343+
if (is_null($calendarHomePath)) return null;
344+
return new Href($calendarHomePath . '/');
334345

335346
});
336347
// The calendar-user-address-set property is basically mapped to

lib/CalDAV/Schedule/Plugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ function propFind(PropFind $propFind, INode $node) {
210210
$propFind->handle('{' . self::NS_CALDAV . '}schedule-outbox-URL', function() use ($principalUrl, $caldavPlugin) {
211211

212212
$calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl);
213+
if (!$calendarHomePath) {
214+
return null;
215+
}
213216
$outboxPath = $calendarHomePath . '/outbox/';
214217

215218
return new Href($outboxPath);
@@ -219,6 +222,9 @@ function propFind(PropFind $propFind, INode $node) {
219222
$propFind->handle('{' . self::NS_CALDAV . '}schedule-inbox-URL', function() use ($principalUrl, $caldavPlugin) {
220223

221224
$calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl);
225+
if (!$calendarHomePath) {
226+
return null;
227+
}
222228
$inboxPath = $calendarHomePath . '/inbox/';
223229

224230
return new Href($inboxPath);
@@ -231,6 +237,10 @@ function propFind(PropFind $propFind, INode $node) {
231237
// meantime we just grab the first calendar in the home-set.
232238
$calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl);
233239

240+
if (!$calendarHomePath) {
241+
return null;
242+
}
243+
234244
$sccs = '{' . self::NS_CALDAV . '}supported-calendar-component-set';
235245

236246
$result = $this->server->getPropertiesForPath($calendarHomePath, [

lib/CardDAV/Backend/PDO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
151151
* @param string $principalUri
152152
* @param string $url Just the 'basename' of the url.
153153
* @param array $properties
154-
* @return void
154+
* @return int Last insert id
155155
*/
156156
function createAddressBook($principalUri, $url, array $properties) {
157157

lib/CardDAV/Plugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ function propFindEarly(DAV\PropFind $propFind, DAV\INode $node) {
188188
*
189189
* @param string $reportName
190190
* @param \DOMNode $dom
191+
* @param mixed $path
191192
* @return bool
192193
*/
193-
function report($reportName, $dom) {
194+
function report($reportName, $dom, $path) {
194195

195196
switch ($reportName) {
196197
case '{' . self::NS_CARDDAV . '}addressbook-multiget' :

lib/DAV/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class Version {
1414
/**
1515
* Full version number
1616
*/
17-
const VERSION = '3.1.0-alpha2';
17+
const VERSION = '3.1.1';
1818

1919
}

lib/DAVACL/Plugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,10 @@ function propPatch($path, DAV\PropPatch $propPatch) {
981981
*
982982
* @param string $reportName
983983
* @param mixed $report
984+
* @param mixed $path
984985
* @return bool
985986
*/
986-
function report($reportName, $report) {
987+
function report($reportName, $report, $path) {
987988

988989
switch ($reportName) {
989990

lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function toHtml(HtmlOutputHelper $html) {
114114

115115
ob_start();
116116
echo "<ul class=\"tree\">";
117-
$traverse($this->getValue(), '');
117+
$traverse($this->getValue());
118118
echo "</ul>\n";
119119

120120
return ob_get_clean();

0 commit comments

Comments
 (0)