Send back displayname if requested

FossilOrigin-Name: 850952403fcbd033251778db0e7135ea064bddbf678683a0c34907b0d4dcb947
This commit is contained in:
bohwaz 2022-12-23 20:25:05 +00:00
parent 8ad0953bc5
commit 5c660d8ecc
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':