From f440ffa224b2b908b53106cccf5917370f655953 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 28 Jun 2020 19:38:17 +0200 Subject: [PATCH] check for prefixorgfilename in PROPFIND --- webdav/webdav.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webdav/webdav.php b/webdav/webdav.php index df64fee88..9b2b07fd7 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -407,8 +407,17 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $path .= $pathseg->getName().'/'; // $info["path"] = htmlspecialchars($path.rawurlencode($obj->getName())); if($this->useorgfilename) { - $info["path"] = $path.$content->getOriginalFileName(); - $info["props"][] = $this->mkprop("displayname", $content->getOriginalFileName()); + /* Add the document id and version to the display name. + * I doesn't harm because for + * accessing the document the full path is used by the browser + */ + if($this->prefixorgfilename) { + $info["path"] = $path.$obj->getID()."-".$content->getVersion()."-".$content->getOriginalFileName(); + $info["props"][] = $obj->getID()."-".$content->getVersion()."-".$content->getOriginalFileName(); + } else { + $info["path"] = $path.$content->getOriginalFileName(); + $info["props"][] = $this->mkprop("displayname", $content->getOriginalFileName()); + } } else { $info["path"] = $path.$obj->getName(); $info["props"][] = $this->mkprop("displayname", $obj->getName());