Skip to content

Commit

Permalink
Merge branch '1.7' into 1.8
Browse files Browse the repository at this point in the history
Conflicts:
	lib/Sabre/CalDAV/SharingPlugin.php
	lib/Sabre/CalDAV/Version.php
	lib/Sabre/DAVACL/Plugin.php
  • Loading branch information
evert committed Nov 19, 2012
2 parents 1d5588a + 1e66b44 commit 9ea5c15
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* Fixed: Removing double slashes from getPropertiesForPath.
* Change: Marked a few more properties in the CardDAV as protected,
instead of private.
* Fixed: SharingPlugin now place nicer with other plugins with similar
functionality.

1.7.2-stable (2012-11-08)
* The zip release ships with sabre/vobject 2.0.5.
Expand Down
15 changes: 13 additions & 2 deletions lib/Sabre/CalDAV/SharingPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function updateProperties(array &$mutations, array &$result, DAV\INode $n
}

// Only doing something if shared-owner is indeed not in the list.
if($mutations['{DAV:}resourcetype']->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) return;
if($mutations['{DAV:}resourcetype']->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) return;

$shares = $node->getShares();
$remove = array();
Expand Down Expand Up @@ -281,8 +281,18 @@ public function unknownMethod($method, $uri) {
return;
}

$requestBody = $this->server->httpRequest->getBody(true);

$dom = DAV\XMLUtil::loadDOMDocument($this->server->httpRequest->getBody(true));
// If this request handler could not deal with this POST request, it
// will return 'null' and other plugins get a chance to handle the
// request.
//
// However, we already requested the full body. This is a problem,
// because a body can only be read once. This is why we preemptively
// re-populated the request body with the existing data.
$this->server->httpRequest->setBody($requestBody);

$dom = DAV\XMLUtil::loadDOMDocument($requestBody);

$documentType = DAV\XMLUtil::toClarkNotation($dom->firstChild);

Expand Down Expand Up @@ -426,6 +436,7 @@ public function unknownMethod($method, $uri) {
}



}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Sabre/CalDAV/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Version {
/**
* Full version number
*/
const VERSION = '1.8.0';
const VERSION = '1.8.1';

/**
* Stability : alpha, beta, stable
Expand Down
3 changes: 1 addition & 2 deletions lib/Sabre/DAVACL/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getSupportedReportSet($uri) {
* @param string $uri
* @param array|string $privileges
* @param int $recursion
* @param bool $throwExceptions if set to false, this method won't through exceptions.
* @param bool $throwExceptions if set to false, this method won't throw exceptions.
* @throws Sabre\DAVACL\Exception\NeedPrivileges
* @return bool
*/
Expand Down Expand Up @@ -559,7 +559,6 @@ public function getCurrentUserPrivilegeSet($node) {
}



}

// Now we deduct all aggregated privileges.
Expand Down
4 changes: 4 additions & 0 deletions tests/Sabre/CalDAV/SharingPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ function testInviteWrongUrl() {
$response = $this->request($request);
$this->assertEquals('HTTP/1.1 501 Not Implemented', $response->status, $response->body);

// If the plugin did not handle this request, it must ensure that the
// body is still accessible by other plugins.
$this->assertEquals($xml, $request->getBody(true));

}

function testPublish() {
Expand Down

0 comments on commit 9ea5c15

Please sign in to comment.