urlencode and decode account_lid in url to cope with group-names with space in it, which stall iPhone OS 4.2 devices

This commit is contained in:
Ralf Becker 2010-10-20 14:37:48 +00:00
parent 20fb58dd6a
commit 4e65bde081
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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();