Fix SQL syntax error if is-not-defined is used as a prop-filter.

This commit is contained in:
Tobias Brox 2023-01-28 08:56:38 +01:00 committed by Andrew Ruthven
parent 533d407196
commit 6e6ff6b115

View File

@ -88,7 +88,7 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
$not_defined = "";
switch( $tag ) {
case 'urn:ietf:params:xml:ns:caldav:is-not-defined':
$not_defined = "not-"; // then fall through to IS-DEFINED case
$not_defined = "not"; // then fall through to IS-DEFINED case
case 'urn:ietf:params:xml:ns:caldav:is-defined':
if ( isset( $parameter ) ) {
$need_post_filter = true;
@ -114,7 +114,7 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
default:
$property_defined_match = "LIKE '_%'"; // i.e. contains a single character or more
}
$sql .= sprintf( "AND %s %s%s ", $property, $not_defined, $property_defined_match );
$sql .= sprintf( "AND %s %s %s ", $property, $not_defined, $property_defined_match );
}
break;