From 38788acc5cbec147d6a46a6254ef8eec0a270c71 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Tue, 16 May 2017 13:33:19 +1200 Subject: [PATCH] Support http://.../freebusy.php?foo@example.com Sometimes users set the Free/Busy URL to have a ?, not a /. Let's support that. --- htdocs/freebusy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/freebusy.php b/htdocs/freebusy.php index 0499e02f..b1b723ba 100644 --- a/htdocs/freebusy.php +++ b/htdocs/freebusy.php @@ -44,7 +44,7 @@ if ( isset($fb_user) ) $_SERVER['PATH_INFO'] = '/'.$fb_user.'/'; require_once("CalDAVRequest.php"); $request = new CalDAVRequest(array("allow_by_email" => 1)); $path_match = '^'.$request->path; -if ( preg_match( '{^/(\S+@[a-z0-9][a-z0-9-]*[.][a-z0-9.-]+)/?$}i', $request->path, $matches ) ) { +if ( preg_match( '{^/(\S+@[a-z0-9][a-z0-9-]*[.][a-z0-9.-]+)[/?]+?$}i', $request->path, $matches ) ) { $principal = new Principal('email',$matches[1]); $path_match = '^'.$principal->dav_name(); }