Card search invalid when negate-condition="no" (fixes #126)

Thanks Bart Vullings for reporting the bug and providing a fix!
This commit is contained in:
Florian Schlichting 2017-09-20 16:15:58 +02:00
parent b550352aa5
commit 10bb69d0a0

View File

@ -163,7 +163,7 @@ function SqlFilterCardDAV( $filter, $components, $property = null, $parameter =
$params[$pname] = $search; $params[$pname] = $search;
$negate = $filter->GetAttribute("negate-condition"); $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 ); dbg_error_log("cardquery", " text-match: (%s%s %s '%s') ", $negate, $property, $comparison, $search );
$sql .= sprintf( "(%s%s %s $pname)", $negate, $property, $comparison ); $sql .= sprintf( "(%s%s %s $pname)", $negate, $property, $comparison );
break; break;