Send back displayname if requested

This commit is contained in:
bohwaz 2022-12-23 21:25:05 +01:00
parent 59669cb6c9
commit 629403661a
2 changed files with 6 additions and 2 deletions

View file

@ -1478,6 +1478,8 @@ namespace PicoDAV
$target = $this->path . $uri;
switch ($name) {
case 'DAV::displayname':
return basename($uri);
case 'DAV::getcontentlength':
return is_dir($target) ? null : filesize($target);
case 'DAV::getcontenttype':
@ -1888,11 +1890,11 @@ RewriteRule ^.*$ /index.php [END]
$fp = fopen(__FILE__, 'r');
if ($relative_uri == '.webdav/webdav.js') {
fseek($fp, 50637, SEEK_SET);
fseek($fp, 50694, SEEK_SET);
echo fread($fp, 27769);
}
else {
fseek($fp, 50637 + 27769, SEEK_SET);
fseek($fp, 50694 + 27769, SEEK_SET);
echo fread($fp, 7004);
}

View file

@ -197,6 +197,8 @@ namespace PicoDAV
$target = $this->path . $uri;
switch ($name) {
case 'DAV::displayname':
return basename($uri);
case 'DAV::getcontentlength':
return is_dir($target) ? null : filesize($target);
case 'DAV::getcontenttype':