summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-08-19 10:10:09 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-08-19 10:10:09 +0200
commit1c23f54d42a45de37edd85c7b92547f466e6982d (patch)
treeaecc0a0005c92dd19dd686147c24317a6a971fab
parentdf963b3ccfee30c3c786ce19099b2e739da00baf (diff)
parent4d32e3548b948361587cba3ebf9af01e0c8152ee (diff)
downloadnextcloud-server-1c23f54d42a45de37edd85c7b92547f466e6982d.tar.gz
nextcloud-server-1c23f54d42a45de37edd85c7b92547f466e6982d.zip
Merge pull request #10341 from owncloud/issue/9928
[Issue/9928] Problems with filemtime in MappedLocal Storage
-rw-r--r--lib/private/files/cache/updater.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index f15c203cd58..0e5e07c587d 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -114,22 +114,23 @@ class Updater {
/**
* get file owner and path
* @param string $filename
- * @return string[] with the oweners uid and the owners path
+ * @return string[] with the owner's uid and the owner's path
*/
private static function getUidAndFilename($filename) {
$uid = \OC\Files\Filesystem::getOwner($filename);
\OC\Files\Filesystem::initMountPoints($uid);
+ $filename = (strpos($filename, '/') !== 0) ? '/' . $filename : $filename;
if ($uid != \OCP\User::getUser()) {
$info = \OC\Files\Filesystem::getFileInfo($filename);
if (!$info) {
- return array($uid, '/files/' . $filename);
+ return array($uid, '/files' . $filename);
}
$ownerView = new \OC\Files\View('/' . $uid . '/files');
$filename = $ownerView->getPath($info['fileid']);
}
- return array($uid, '/files/' . $filename);
+ return array($uid, '/files' . $filename);
}
/**
@@ -139,8 +140,7 @@ class Updater {
* @param string $time
*/
static public function correctFolder($path, $time) {
- if ($path !== '' && $path !== '/') {
-
+ if ($path !== '' && $path !== '/' && $path !== '\\') {
list($owner, $realPath) = self::getUidAndFilename(dirname($path));
/**
@@ -181,6 +181,11 @@ class Updater {
$cache = $storage->getCache();
$parentId = $cache->getParentId($internalPath);
$parent = dirname($internalPath);
+
+ if ($parent === '.' || $parent === '/' || $parent === '\\') {
+ $parent = '';
+ }
+
if ($parentId != -1) {
$cache->update($parentId, array('storage_mtime' => $storage->filemtime($parent)));
}