$components = array();
    $filter_fragment = SqlFilterCardDAV($qry_filters, $components);
    if ($filter_fragment !== false) {
        $where .= ' ' . $filter_fragment['sql'];
        $params = $filter_fragment['params'];
    }
} else {
    dbg_error_log('cardquery', 'No query filters');
}
$sql = 'SELECT * FROM caldav_data INNER JOIN addressbook_resource USING(dav_id)' . $where;
if (isset($c->strict_result_ordering) && $c->strict_result_ordering) {
    $sql .= " ORDER BY dav_id";
}
$qry = new AwlQuery($sql, $params);
if ($qry->Exec("cardquery", __LINE__, __FILE__) && $qry->rows() > 0) {
    while ($address_object = $qry->Fetch()) {
        if (!$need_post_filter || apply_filter($qry_filters, $address_object)) {
            if ($bound_from != $target_collection->dav_name()) {
                $address_object->dav_name = str_replace($bound_from, $target_collection->dav_name(), $address_object->dav_name);
            }
            if (count($address_data_properties) > 0) {
                $vcard = new VCard($address_object->caldav_data);
                $vcard->MaskProperties($address_data_properties);
                $address_object->caldav_data = $vcard->Render();
            }
            $responses[] = component_to_xml($properties, $address_object);
        }
    }
}
$multistatus = new XMLElement("multistatus", $responses, $reply->GetXmlNsArray());
$request->XMLResponse(207, $multistatus);