mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-19 16:46:01 +00:00
cardquery: a prop-filter without an actual filter rule means we simply need to ensure the property exists
This guards against a crash when calling ->GetNSTag() on a non-object. This may need to be refined in case we could be dealing with something that's not a prop-filter.
This commit is contained in:
parent
06e20e5508
commit
29e2dbfe92
@ -109,13 +109,20 @@ function SqlFilterCardDAV( $filter, $components, $property = null, $parameter =
|
||||
$sql = "";
|
||||
$params = array();
|
||||
|
||||
// a prop-filter without an actual filter rule means we simply need to ensure the property exists
|
||||
if ( !is_object($filter) ) {
|
||||
if ( empty($property) ) return false;
|
||||
$sql .= $property . ' IS NOT NULL';
|
||||
return array( 'sql' => $sql, 'params' => $params );
|
||||
}
|
||||
|
||||
$tag = $filter->GetNSTag();
|
||||
dbg_error_log("cardquery", "Processing $tag into SQL - %d, '%s', %d\n", count($components), $property, isset($parameter) );
|
||||
|
||||
$not_defined = "";
|
||||
switch( $tag ) {
|
||||
case 'urn:ietf:params:xml:ns:carddav:is-not-defined':
|
||||
$sql .= $property . 'IS NULL';
|
||||
$sql .= $property . ' IS NULL';
|
||||
break;
|
||||
|
||||
case 'urn:ietf:params:xml:ns:carddav:text-match':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user