summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Michelino <michelinux@gmail.com>2011-04-20 13:28:35 +0200
committerMarco Michelino <michelinux@gmail.com>2011-04-20 13:28:35 +0200
commit4e2ef271bc7b2e5ff2ea81ee5e4b1442cadd0e41 (patch)
treeecebd7a6c0f3243b25f90f0b0a849d5175bdbbe8
parent85dd7129a874f4ae92657c9d27b9079c2b9f4d41 (diff)
downloadnextcloud-server-4e2ef271bc7b2e5ff2ea81ee5e4b1442cadd0e41.tar.gz
nextcloud-server-4e2ef271bc7b2e5ff2ea81ee5e4b1442cadd0e41.zip
bugfixes on GET requests via WebDAV
-rw-r--r--lib/HTTP/WebDAV/Server/Filesystem.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/HTTP/WebDAV/Server/Filesystem.php b/lib/HTTP/WebDAV/Server/Filesystem.php
index 49b2397175a..9cebee48d7c 100644
--- a/lib/HTTP/WebDAV/Server/Filesystem.php
+++ b/lib/HTTP/WebDAV/Server/Filesystem.php
@@ -297,12 +297,16 @@
while ($filename = readdir($handle)) {
if ($filename != "." && $filename != "..") {
- $fullpath = $fspath."/".$filename;
+ if( substr($fspath, -1) != '/' ){
+ $fspath .= '/';
+ }
+ $fullpath = $fspath.$filename;
$name = htmlspecialchars($filename);
+ $uri = $_SERVER['SCRIPT_NAME'] . $fullpath;
printf($format,
- number_format(filesize($fullpath)),
- strftime("%Y-%m-%d %H:%M:%S", filemtime($fullpath)),
- "<a href='$name'>$name</a>");
+ number_format(OC_FILESYSTEM::filesize($fullpath)),
+ strftime("%Y-%m-%d %H:%M:%S", OC_FILESYSTEM::filemtime($fullpath)),
+ "<a href='$uri'>$name</a>");
}
}
@@ -745,4 +749,4 @@ VALUES (?,?,?,?,?,'timeout',?,?)");
}
}
-?> \ No newline at end of file
+?>