mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-21 17:06:22 +00:00
Changes to Depth handling.
This commit is contained in:
parent
85017681d0
commit
946e0719ef
@ -230,8 +230,11 @@ class CalDAVRequest
|
||||
$this->depth = 'infinity';
|
||||
break;
|
||||
|
||||
case 'PROPFIND':
|
||||
case 'REPORT':
|
||||
$this->depth = 0;
|
||||
break;
|
||||
|
||||
case 'PROPFIND':
|
||||
default:
|
||||
$this->depth = 0;
|
||||
}
|
||||
@ -740,8 +743,9 @@ EOSQL;
|
||||
* Returns the tail of a Regex appropriate for this Depth, when appended to
|
||||
*
|
||||
*/
|
||||
function DepthRegexTail() {
|
||||
function DepthRegexTail( $for_collection_report = false) {
|
||||
if ( $this->IsInfiniteDepth() ) return '';
|
||||
if ( $this->depth == 0 && $for_collection_report ) return '[^/]+$';
|
||||
if ( $this->depth == 0 ) return '$';
|
||||
return '[^/]*/?$';
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ $range_end = new RepeatRuleDateTime($fbq_end);
|
||||
|
||||
|
||||
/** We use the same code for the REPORT, the POST and the freebusy GET... */
|
||||
$freebusy = get_freebusy( '^'.$request->path.$request->DepthRegexTail(), $range_start, $range_end );
|
||||
$freebusy = get_freebusy( '^' . $request->path . $request->DepthRegexTail(true), $range_start, $range_end );
|
||||
|
||||
$result = new iCalComponent();
|
||||
$result->VCalendar();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user