From c23f7fc95bbcfbcbc9104e976c546bb162dcbe1c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 13 Aug 2012 09:32:03 +0000 Subject: [PATCH] * WebDAV/GroupDAV/CalDAV/CardDAV: removed option only used for old KDE GroupDAV resource and unknown WebDAV clients producing invalid XML, fix for community bug #3152 --- files/webdav.php | 8 -------- phpgwapi/inc/class.groupdav.inc.php | 14 ++------------ webdav.php | 8 -------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/files/webdav.php b/files/webdav.php index 9e4a674c3a..37b8ea96fc 100644 --- a/files/webdav.php +++ b/files/webdav.php @@ -86,13 +86,5 @@ if (strpos($_SERVER['REQUEST_URI'],'/webdav.php/clientsync') !== false && $GLOBALS['egw']->session->commit_session(); $webdav_server = new vfs_webdav_server(); -$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); -if (strstr($user_agent, 'microsoft-webdav') !== false || - strstr($user_agent, 'neon') !== false || - strstr($user_agent, 'bitkinex') !== false) -{ - // Windows 7 et.al. special treatment - $webdav_server->cnrnd = true; -} $webdav_server->ServeRequest(); //error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime)); diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index d6ada704b8..6f1f516e97 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -209,39 +209,29 @@ class groupdav extends HTTP_WebDAV_Server set_exception_handler(array(__CLASS__,'exception_handler')); // crrnd: client refuses redundand namespace declarations - // cnrnd: client needs redundand namespace declarations // setting redundand namespaces as the default for (Cal|Card|Group)DAV, as the majority of the clients either require or can live with it - $this->cnrnd = true; + $this->crrnd = false; // identify clients, which do NOT support path AND full url in of PROPFIND request switch(($agent = groupdav_handler::get_agent())) { - case 'akonadi': - $this->cnrnd = true; // Akonadi seems to require redundant namespaces, see KDE bug #265096 https://bugs.kde.org/show_bug.cgi?id=265096 - break; case 'kde': // KAddressbook (at least in 3.5 can NOT subscribe / does NOT find addressbook) $this->client_require_href_as_url = true; - $this->cnrnd = false; // KDE before Akonadi seems NOT to work with cnrnd (redundant namespaces) break; case 'cfnetwork': // Apple addressbook app case 'dataaccess': // iPhone addressbook $this->client_require_href_as_url = false; - $this->cnrnd = true; break; case 'davkit': // iCal app in OS X 10.6 created wrong request, if full url given case 'coredav': // iCal app in OS X 10.7 case 'calendarstore': // Apple iCal 5.0.1 under OS X 10.7.2 $this->client_require_href_as_url = false; - $this->cnrnd = true; break; case 'cfnetwork_old': $this->crrnd = true; // Older Apple Addressbook.app does not cope with namespace redundancy break; - case 'neon': - $this->cnrnd = true; // neon clients like cadaver - break; } - if ($this->debug) error_log(__METHOD__."() HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]' --> '$agent' --> client_requires_href_as_url=$this->client_require_href_as_url, crrnd(client refuses redundand namespace declarations)=$this->crrnd, cnrnd(client needs redundand namespace declarations)=$this->cnrnd"); + if ($this->debug) error_log(__METHOD__."() HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]' --> '$agent' --> client_requires_href_as_url=$this->client_require_href_as_url, crrnd(client refuses redundand namespace declarations)=$this->crrnd"); // adding EGroupware version to X-Dav-Powered-By header eg. "EGroupware 1.8.001 CalDAV/CardDAV/GroupDAV server" $this->dav_powered_by = str_replace('EGroupware','EGroupware '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'], diff --git a/webdav.php b/webdav.php index eb427dbf67..927c9816ce 100644 --- a/webdav.php +++ b/webdav.php @@ -70,13 +70,5 @@ catch (egw_exception_no_permission_app $e) $GLOBALS['egw']->session->commit_session(); $webdav_server = new vfs_webdav_server(); -$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); -if (strstr($user_agent, 'microsoft-webdav') !== false || - strstr($user_agent, 'neon') !== false || - strstr($user_agent, 'bitkinex') !== false) -{ - // Windows 7 et.al. special treatment - $webdav_server->cnrnd = true; -} $webdav_server->ServeRequest(); //error_log(sprintf('WebDAV %s request: status "%s", took %5.3f s'.($headertime?' (header include took %5.3f s)':''),$_SERVER['REQUEST_METHOD'].' '.$_SERVER['PATH_INFO'],$webdav_server->_http_status,microtime(true)-$starttime,$headertime-$starttime));