diff --git a/lib/CardDAV/Plugin.php b/lib/CardDAV/Plugin.php index 09d1f593da..7097c8569b 100644 --- a/lib/CardDAV/Plugin.php +++ b/lib/CardDAV/Plugin.php @@ -587,7 +587,14 @@ protected function validateParamFilters(array $vProperties, array $filters, $tes foreach ($vProperties as $vProperty) { // If we got all the way here, we'll need to validate the // text-match filter. - $success = DAV\StringUtil::textMatch($vProperty[$filter['name']]->getValue(), $filter['text-match']['value'], $filter['text-match']['collation'], $filter['text-match']['match-type']); + if (isset($vProperty[$filter['name']])) { + $success = DAV\StringUtil::textMatch( + $vProperty[$filter['name']]->getValue(), + $filter['text-match']['value'], + $filter['text-match']['collation'], + $filter['text-match']['match-type'] + ); + } if ($success) { break; } diff --git a/lib/DAV/Xml/Element/Response.php b/lib/DAV/Xml/Element/Response.php index 45c161fa4f..5a4834e230 100644 --- a/lib/DAV/Xml/Element/Response.php +++ b/lib/DAV/Xml/Element/Response.php @@ -112,13 +112,14 @@ public function getResponseProperties() */ public function xmlSerialize(Writer $writer) { + $empty = true; + if ($status = $this->getHTTPStatus()) { + $empty = false; $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); } $writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref())); - $empty = true; - foreach ($this->getResponseProperties() as $status => $properties) { // Skipping empty lists if (!$properties || (!ctype_digit($status) && !is_int($status))) { diff --git a/tests/Sabre/DAVACL/PrincipalMatchTest.php b/tests/Sabre/DAVACL/PrincipalMatchTest.php index 0746d2e50e..7862f2c59d 100644 --- a/tests/Sabre/DAVACL/PrincipalMatchTest.php +++ b/tests/Sabre/DAVACL/PrincipalMatchTest.php @@ -30,10 +30,6 @@ public function testPrincipalMatch() HTTP/1.1 200 OK /principals/user1 - - - HTTP/1.1 418 I'm a teapot - XML;