From 10bb69d0a056b19dda4b98afa057bad9c5df4f60 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Wed, 20 Sep 2017 16:15:58 +0200 Subject: [PATCH] Card search invalid when negate-condition="no" (fixes #126) Thanks Bart Vullings for reporting the bug and providing a fix! --- inc/caldav-REPORT-cardquery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/caldav-REPORT-cardquery.php b/inc/caldav-REPORT-cardquery.php index b629cecf..f85a9d56 100644 --- a/inc/caldav-REPORT-cardquery.php +++ b/inc/caldav-REPORT-cardquery.php @@ -163,7 +163,7 @@ function SqlFilterCardDAV( $filter, $components, $property = null, $parameter = $params[$pname] = $search; $negate = $filter->GetAttribute("negate-condition"); - $negate = ( (isset($negate) && strtolower($negate) ) == "yes" ) ? "NOT " : ""; + $negate = ( isset($negate) && strtolower($negate) == "yes" ) ? "NOT " : ""; dbg_error_log("cardquery", " text-match: (%s%s %s '%s') ", $negate, $property, $comparison, $search ); $sql .= sprintf( "(%s%s %s $pname)", $negate, $property, $comparison ); break;