From 9ff2ac03cc416937a511bbee7bbe238c0d908447 Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Mon, 11 Jul 2016 00:45:48 +0100 Subject: [PATCH 1/2] fixing php 32 bit (arm) filemtime on large file issue (#18971) --- lib/private/Files/Storage/Local.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 005b5f9ab91f..4e4d444dc580 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 exec ('stat -c %Y '. escapeshellarg ($fullPath)); + } + return filemtime($fullPath); } public function touch($path, $mtime = null) { From 563b4d297c6c8f9c47f9f0469ae51ccfce084d3a Mon Sep 17 00:00:00 2001 From: Boris Rybalkin Date: Wed, 3 Aug 2016 09:18:27 +0100 Subject: [PATCH 2/2] cast to int --- lib/private/Files/Storage/Local.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 4e4d444dc580..95b05ea28a3b 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -173,7 +173,7 @@ public function filemtime($path) { return false; } if (PHP_INT_SIZE === 4) { - return exec ('stat -c %Y '. escapeshellarg ($fullPath)); + return (int) exec ('stat -c %Y '. escapeshellarg ($fullPath)); } return filemtime($fullPath); }