From 1bc9aca11001431f112ed11c905659e14d099895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Thu, 25 Mar 2010 14:17:21 +0000 Subject: [PATCH] Fix Windows 7 WebDAV issue --- egw-pear/HTTP/WebDAV/Server.php | 4 +++- webdav.php | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/egw-pear/HTTP/WebDAV/Server.php b/egw-pear/HTTP/WebDAV/Server.php index 69042639d8..87a986c7ab 100644 --- a/egw-pear/HTTP/WebDAV/Server.php +++ b/egw-pear/HTTP/WebDAV/Server.php @@ -65,8 +65,10 @@ class HTTP_WebDAV_Server * But some clients can NOT deal with one or the other! * * @var boolean (client_refuses_redundand_namespace_declarations) + * @var boolean (client_needs_redundand_namespace_declarations) */ var $crrnd = false; + var $cnrnd = false; /** @@ -2307,7 +2309,7 @@ class HTTP_WebDAV_Server $ret = ''; foreach($props as $prop) { - $ret .= '<'.$prop['name']. + $ret .= '<'.(($prop['ns'] == 'DAV:' && $this->cnrnd) ? 'D:' : '').$prop['name']. ($prop['ns'] != 'DAV:' ? ' xmlns="'.$prop['ns'].'"' : ''). (empty($prop['val']) ? ' />' : '>'. (is_array($prop['val']) ? diff --git a/webdav.php b/webdav.php index 7aa66752fb..5cb1b17107 100644 --- a/webdav.php +++ b/webdav.php @@ -96,5 +96,11 @@ 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) +{ + // Windows 7 special treatment + $webdav_server->cnrnd = true; +} $webdav_server->ServeRequest(); //error_log(sprintf("WebDAV %s request took %5.3f s (header include took %5.3f s)",$_SERVER['REQUEST_METHOD'],microtime(true)-$starttime,$headertime-$starttime));