diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-12-02 16:22:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 16:22:24 +0100 |
commit | e580f91143cedcc0a369664a6b1097ba09604f45 (patch) | |
tree | f5497df7cb486afc76ecd474662d56e25dab5747 /lib | |
parent | 32f6bdf067ac877073af45b9170b042ebc0f790b (diff) | |
parent | ac0c7a8fe0223c3d99d01c17302b7097defcb502 (diff) | |
download | nextcloud-server-e580f91143cedcc0a369664a6b1097ba09604f45.tar.gz nextcloud-server-e580f91143cedcc0a369664a6b1097ba09604f45.zip |
Merge pull request #23257 from aler9/patch-32bit-filesize-master
Fix file size computation on 32bit platforms
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Local.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 591ee96c99b..f0a81f48930 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -146,8 +146,8 @@ class Local extends \OC\Files\Storage\Common { public function stat($path) { $fullPath = $this->getSourcePath($path); clearstatcache(true, $fullPath); - $statResult = stat($fullPath); - if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { + $statResult = @stat($fullPath); + if (PHP_INT_SIZE === 4 && $statResult && !$this->is_dir($path)) { $filesize = $this->filesize($path); $statResult['size'] = $filesize; $statResult[7] = $filesize; @@ -159,9 +159,7 @@ class Local extends \OC\Files\Storage\Common { * @inheritdoc */ public function getMetaData($path) { - $fullPath = $this->getSourcePath($path); - clearstatcache(true, $fullPath); - $stat = @stat($fullPath); + $stat = $this->stat($path); if (!$stat) { return null; } @@ -180,6 +178,7 @@ class Local extends \OC\Files\Storage\Common { } if (!($path === '' || $path === '/')) { // deletable depends on the parents unix permissions + $fullPath = $this->getSourcePath($path); $parent = dirname($fullPath); if (is_writable($parent)) { $permissions += Constants::PERMISSION_DELETE; |