aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-12-02 20:03:24 +0100
committerGitHub <noreply@github.com>2020-12-02 20:03:24 +0100
commitbdbb60a67b66c69ef4bfd8845450636eab73f757 (patch)
tree48c65e5d53ba9229fb7c9d8efeda55559e34023e /lib/private
parent4d68c618e3362f611d76da15224da1941474fea3 (diff)
parentdc7eb53a8ff1215e6510b4767788992adeaa9914 (diff)
downloadnextcloud-server-bdbb60a67b66c69ef4bfd8845450636eab73f757.tar.gz
nextcloud-server-bdbb60a67b66c69ef4bfd8845450636eab73f757.zip
Merge pull request #24509 from nextcloud/backport/23257/stable20
[stable20] Fix file size computation on 32bit platforms
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Storage/Local.php9
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;