summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-08 09:57:17 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-08 09:57:17 +0200
commit87c150e2fb702d7f43691bd5a80d704214b74aed (patch)
tree602ec9255ed215f3225954e5324f0d416c9f5f5f
parent652b4961f2018f59a13ae769e20ca3de32bc7d30 (diff)
parent2cf7ad8c55e20b388c8b5bc56fb343273346b6e2 (diff)
downloadnextcloud-server-87c150e2fb702d7f43691bd5a80d704214b74aed.tar.gz
nextcloud-server-87c150e2fb702d7f43691bd5a80d704214b74aed.zip
Merge pull request #25005 from owncloud/parent-storage-time-cast
don't update storage mtime if we can't get the modified date
-rw-r--r--lib/private/Files/Cache/Updater.php5
-rw-r--r--lib/private/Files/Storage/Common.php3
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index 820941abae1..4e17c4d778d 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -231,7 +231,10 @@ class Updater implements IUpdater {
$parentId = $this->cache->getParentId($internalPath);
$parent = dirname($internalPath);
if ($parentId != -1) {
- $this->cache->update($parentId, array('storage_mtime' => $this->storage->filemtime($parent)));
+ $mtime = $this->storage->filemtime($parent);
+ if ($mtime !== false) {
+ $this->cache->update($parentId, array('storage_mtime' => $mtime));
+ }
}
}
}
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index cec6a42a2c0..0c1b69108d4 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -643,6 +643,9 @@ abstract class Common implements Storage, ILockingStorage {
$data = [];
$data['mimetype'] = $this->getMimeType($path);
$data['mtime'] = $this->filemtime($path);
+ if ($data['mtime'] === false) {
+ $data['mtime'] = time();
+ }
if ($data['mimetype'] == 'httpd/unix-directory') {
$data['size'] = -1; //unknown
} else {