From 323292eb8c66fcc1bc094287e0377f1259292f38 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Sat, 8 Apr 2017 14:41:50 +0200 Subject: [PATCH] log an error instead of crashing on principal-property-search REPORT without a proper match clause (fix #114) --- inc/caldav-REPORT-principal.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/caldav-REPORT-principal.php b/inc/caldav-REPORT-principal.php index 7cee9ccf..f979bdfe 100644 --- a/inc/caldav-REPORT-principal.php +++ b/inc/caldav-REPORT-principal.php @@ -20,6 +20,10 @@ $where = ""; foreach( $searches AS $k => $search ) { $qry_props = $search->GetPath('/DAV::property-search/DAV::prop/*'); // There may be many $match = $search->GetPath('/DAV::property-search/DAV::match'); // There may only be one + if ( empty($match) or !is_object($match[0]) ) { + dbg_error_log("ERROR", "Unable to extract a match clause from '%s'", $search->RenderContent() ); + continue; + } dbg_log_array( "principal", "MATCH", $match, true ); $match = $match[0]->GetContent(); $subwhere = "";