From 77117734e700ac1081cc41cd462dd90d3ef016dc Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 11 Dec 2006 19:16:01 +1300 Subject: [PATCH] Useful element for building regex matching a path + depth. --- inc/CalDAVRequest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 8cd33f7b..d728743c 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -220,6 +220,16 @@ class CalDAVRequest return $this->depth; } + /** + * Returns the tail of a Regex appropriate for this Depth, when appended to + * + */ + function DepthRegexTail( ) { + if ( $this->IsInfiniteDepth() ) return ''; + if ( $this->depth == 0 ) return '$'; + return '[^/]*/?$'; + } + /** * Returns the locked row, either from the cache or from the database *