diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 005b5f9ab91f..95b05ea28a3b 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -167,8 +167,15 @@ public function file_exists($path) { } public function filemtime($path) { - clearstatcache($this->getSourcePath($path)); - return $this->file_exists($path) ? filemtime($this->getSourcePath($path)) : false; + $fullPath = $this->getSourcePath($path); + clearstatcache($fullPath); + if (!$this->file_exists($path)) { + return false; + } + if (PHP_INT_SIZE === 4) { + return (int) exec ('stat -c %Y '. escapeshellarg ($fullPath)); + } + return filemtime($fullPath); } public function touch($path, $mtime = null) {