]> source.dussan.org Git - nextcloud-server.git/commitdiff
bugfixes on GET requests via WebDAV
authorMarco Michelino <michelinux@gmail.com>
Wed, 20 Apr 2011 11:28:35 +0000 (13:28 +0200)
committerMarco Michelino <michelinux@gmail.com>
Wed, 20 Apr 2011 11:28:35 +0000 (13:28 +0200)
lib/HTTP/WebDAV/Server/Filesystem.php

index 49b2397175a5b0082c77b8dd71ca9efcdacff0a7..9cebee48d7c9dbade52922ce5a1ad44aa32e56c7 100644 (file)
 
         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
+?>