Fix Windows 7 WebDAV issue

This commit is contained in:
Jörg Lehrke 2010-03-25 14:17:21 +00:00
parent e1fb66f4a1
commit 1bc9aca110
2 changed files with 9 additions and 1 deletions

View File

@ -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']) ?

View File

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