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

This commit is contained in:
Tobias Brox authored and Andrew Ruthven committed 2023-02-04 03:09:40 +00:00
1 parent 533d407196
commit 6e6ff6b115
1 file changed
+2 -2
+2 -2
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;