From 4e65bde081019ca9f5915be2da02db4951dc4058 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 20 Oct 2010 14:37:48 +0000 Subject: [PATCH] urlencode and decode account_lid in url to cope with group-names with space in it, which stall iPhone OS 4.2 devices --- phpgwapi/inc/class.groupdav.inc.php | 4 +++- phpgwapi/inc/class.groupdav_principals.inc.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index 4f568bea7c..a002a5ccbb 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -32,6 +32,7 @@ require_once('HTTP/WebDAV/Server.php'); * Calling one of the above collections with a GET request / regular browser generates an automatic index * from the data of a allprop PROPFIND, allow to browse CalDAV/CardDAV/GroupDAV tree with a regular browser. * + * @todo All principal urls should either contain no account_lid (eg. base64 of it) or use urlencode($account_lid) * @link http://www.groupdav.org GroupDAV spec */ class groupdav extends HTTP_WebDAV_Server @@ -920,7 +921,8 @@ class groupdav extends HTTP_WebDAV_Server } $parts = explode('/', $this->_unslashify($path)); - if (($account_id = $this->accounts->name2id($parts[0], 'account_lid'))) + if (($account_id = $this->accounts->name2id($parts[0], 'account_lid')) || + ($account_id = $this->accounts->name2id($parts[0]=urldecode($parts[0])))) { // /$user/$app/... $user = array_shift($parts); diff --git a/phpgwapi/inc/class.groupdav_principals.inc.php b/phpgwapi/inc/class.groupdav_principals.inc.php index 732165061a..f15630460c 100644 --- a/phpgwapi/inc/class.groupdav_principals.inc.php +++ b/phpgwapi/inc/class.groupdav_principals.inc.php @@ -13,6 +13,8 @@ /** * EGroupware: GroupDAV access: groupdav/caldav/carddav principals handlers + * + * @todo All principal urls should either contain no account_lid (eg. base64 of it) or use urlencode($account_lid) */ class groupdav_principals extends groupdav_handler { @@ -279,7 +281,7 @@ class groupdav_principals extends groupdav_handler if ((in_array('A',$addressbook_home_set) || in_array((string)$id,$addressbook_home_set)) && is_numeric($id) && ($owner = $GLOBALS['egw']->accounts->id2name($id))) { - $addressbooks[] = HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/'.$owner.'/'); + $addressbooks[] = HTTP_WebDAV_Server::mkprop('href',$this->base_uri.'/'.urlencode($owner).'/'); } } $cal_bo = new calendar_bo();