From baeda7dd0fbd00845518993e471e45df377a3e91 Mon Sep 17 00:00:00 2001 From: Megan Watson Date: Tue, 30 Oct 2007 09:00:17 +0000 Subject: [PATCH] BBS-1098 "Mac Goliath as third-party client" Fixed. Fixed the rename function to ignore ._filename resource forks. --- ktwebdav/lib/KTWebDAVServer.inc.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+), 0 deletions(-) diff --git a/ktwebdav/lib/KTWebDAVServer.inc.php b/ktwebdav/lib/KTWebDAVServer.inc.php index fbbd3ec..d69513f 100644 --- a/ktwebdav/lib/KTWebDAVServer.inc.php +++ b/ktwebdav/lib/KTWebDAVServer.inc.php @@ -1678,7 +1678,32 @@ class KTWebDAVServer extends HTTP_WebDAV_Server return "502 bad gateway - No moving to different WebDAV Servers yet"; } */ + $source_path = $options["path"]; + + // Fix for Mac Goliath + // Modified - 30/10/07 + // Mac adds ._filename files when files are added / copied / moved + // we want to ignore them. + if($this->dav_client == 'MG'){ + // Remove filename from path + $aPath = explode('/', $source_path); + $fileName = $aPath[count($aPath)-1]; + +// if(strtolower($fileName) == '.ds_store'){ +// $this->ktwebdavLog("Using a mac client. Ignore the .DS_Store files created with every folder.", 'info', true); +// // ignore +// return "204 No Content"; +// } + + if($fileName[0] == '.' && $fileName[1] == '_'){ + $fileName = substr($fileName, 2); + $this->ktwebdavLog("Using a mac client. Ignore the ._filename files created with every file.", 'info', true); + // ignore + return "204 No Content"; + } + } + $source_res = $this->_folderOrDocument($source_path); if ($source_res === false) { $this->ktwebdavLog("404 Not found - Document was not found.", 'info', true); -- libgit2 0.21.4