Send back displayname if requested
This commit is contained in:
parent
59669cb6c9
commit
629403661a
2 changed files with 6 additions and 2 deletions
|
@ -1478,6 +1478,8 @@ namespace PicoDAV
|
||||||
$target = $this->path . $uri;
|
$target = $this->path . $uri;
|
||||||
|
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
|
case 'DAV::displayname':
|
||||||
|
return basename($uri);
|
||||||
case 'DAV::getcontentlength':
|
case 'DAV::getcontentlength':
|
||||||
return is_dir($target) ? null : filesize($target);
|
return is_dir($target) ? null : filesize($target);
|
||||||
case 'DAV::getcontenttype':
|
case 'DAV::getcontenttype':
|
||||||
|
@ -1888,11 +1890,11 @@ RewriteRule ^.*$ /index.php [END]
|
||||||
$fp = fopen(__FILE__, 'r');
|
$fp = fopen(__FILE__, 'r');
|
||||||
|
|
||||||
if ($relative_uri == '.webdav/webdav.js') {
|
if ($relative_uri == '.webdav/webdav.js') {
|
||||||
fseek($fp, 50637, SEEK_SET);
|
fseek($fp, 50694, SEEK_SET);
|
||||||
echo fread($fp, 27769);
|
echo fread($fp, 27769);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fseek($fp, 50637 + 27769, SEEK_SET);
|
fseek($fp, 50694 + 27769, SEEK_SET);
|
||||||
echo fread($fp, 7004);
|
echo fread($fp, 7004);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,8 @@ namespace PicoDAV
|
||||||
$target = $this->path . $uri;
|
$target = $this->path . $uri;
|
||||||
|
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
|
case 'DAV::displayname':
|
||||||
|
return basename($uri);
|
||||||
case 'DAV::getcontentlength':
|
case 'DAV::getcontentlength':
|
||||||
return is_dir($target) ? null : filesize($target);
|
return is_dir($target) ? null : filesize($target);
|
||||||
case 'DAV::getcontenttype':
|
case 'DAV::getcontenttype':
|
||||||
|
|
Loading…
Reference in a new issue