From d99f8ccc35681aac0540b93763ad0028c4c31ec7 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 6 Nov 2007 17:29:22 +1300 Subject: [PATCH] Enforce a trailling '/' on collections when they are created. --- inc/caldav-MKCALENDAR.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/caldav-MKCALENDAR.php b/inc/caldav-MKCALENDAR.php index 30c35270..4c77affb 100644 --- a/inc/caldav-MKCALENDAR.php +++ b/inc/caldav-MKCALENDAR.php @@ -15,6 +15,10 @@ if ( ! $request->AllowedTo('mkcalendar') ) { } $displayname = $request->path; + +// Enforce trailling '/' on collection name +if ( ! preg_match( '#/$#', $request->path ) ) $request->path .= '/'; + $parent_container = '/'; if ( preg_match( '#^(.*/)([^/]+)(/)?$#', $request->path, $matches ) ) { $parent_container = $matches[1];