diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 09:57:17 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 09:57:17 +0200 |
commit | 87c150e2fb702d7f43691bd5a80d704214b74aed (patch) | |
tree | 602ec9255ed215f3225954e5324f0d416c9f5f5f | |
parent | 652b4961f2018f59a13ae769e20ca3de32bc7d30 (diff) | |
parent | 2cf7ad8c55e20b388c8b5bc56fb343273346b6e2 (diff) | |
download | nextcloud-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.php | 5 | ||||
-rw-r--r-- | lib/private/Files/Storage/Common.php | 3 |
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 { |