From 07bce5f8bd4dafbf4f2899ef73940b5fa22df3a0 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 9 Jul 2012 00:50:46 +1200 Subject: [PATCH] Don't match parameterised url parts as part of collection name. --- inc/CalDAVRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 9102d44b..77379145 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -404,7 +404,7 @@ EOSQL; $this->collection_path = $this->path; $this->_is_principal = true; } - else if ( preg_match( '#^(/[^/]+)/?$#', $this->path, $matches) || preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) { + else if ( preg_match( '#^(/[^/?]+)/?$#', $this->path, $matches) || preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) { $this->collection_id = -1; $this->collection_path = $matches[1].'/'; // Enforce trailling '/' $this->collection_type = 'principal'; @@ -412,7 +412,7 @@ EOSQL; if ( $this->collection_path == $this->path."/" ) { $this->path .= '/'; dbg_error_log( "caldav", "Path is actually a collection - sending Content-Location header." ); - header( "Content-Location: ".ConstructURL($this->path) ); + header( "Content-Loca3tion: ".ConstructURL($this->path) ); } if ( preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) { // Force a depth of 0 on these, which are at the wrong URL.