diff --git a/lib/DAVACL/Plugin.php b/lib/DAVACL/Plugin.php index 03068451ec..7d8c5f4570 100644 --- a/lib/DAVACL/Plugin.php +++ b/lib/DAVACL/Plugin.php @@ -1427,7 +1427,7 @@ protected function principalPropertySearchReport($path, Xml\Request\PrincipalPro } $result = $this->principalSearch( $report->searchProperties, - $report->properties, + (array) $report->properties, $path, $report->test ); diff --git a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php index ead33fd637..f328a4eacf 100644 --- a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php +++ b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php @@ -375,6 +375,36 @@ public function testWrongUri() self::assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->getBodyAsString()); } } + + public function testEmptyRequestProperties() + { + $xml = ' + + + + + + 1 + +'; + + $serverVars = [ + 'REQUEST_METHOD' => 'REPORT', + 'HTTP_DEPTH' => '0', + 'REQUEST_URI' => '/principals', + ]; + + $request = HTTP\Sapi::createFromServerArray($serverVars); + $request->setBody($xml); + + $server = $this->getServer(); + $server->httpRequest = $request; + + $server->exec(); + + self::assertEquals(207, $server->httpResponse->getStatus()); + self::assertStringContainsString('/principals/user1/', $server->httpResponse->getBodyAsString()); + } } class MockPlugin extends Plugin