From 77066997af800213f3f59a996c3d6168f0cfeb8b Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 4 Dec 2006 12:56:02 +1300 Subject: [PATCH] Add an IsCollection() test to the request. --- inc/CalDAVRequest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index cc66b87e..25bf693a 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -145,6 +145,16 @@ class CalDAVRequest } + /** + * Returns true if the URL referenced by this request points at a collection. + */ + function IsCollection( ) { + if ( !isset($this->_is_collection) ) { + $this->_is_collection = preg_match( '#/$#', $this->path ); + } + return $this->_is_collection; + } + /** * Are we allowed to do the requested activity *