From 6822689e381b12df035384b6b25ff8d07e6b57a3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 7 Jun 2016 15:00:59 +0200 Subject: [PATCH 1/2] don't update storage mtime if we can't get the modified date --- lib/private/Files/Cache/Updater.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)); + } } } } From 2cf7ad8c55e20b388c8b5bc56fb343273346b6e2 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 7 Jun 2016 17:09:24 +0200 Subject: [PATCH 2/2] make sure $data['mtime'] is always a timestamp --- lib/private/Files/Storage/Common.php | 3 +++ 1 file changed, 3 insertions(+) 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 {