summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoraler9 <46489434+aler9@users.noreply.github.com>2020-10-07 13:50:29 +0200
committeraler9 <46489434+aler9@users.noreply.github.com>2020-12-02 12:05:14 +0100
commitac0c7a8fe0223c3d99d01c17302b7097defcb502 (patch)
tree988f277ba9659be7fb4aefd8d3d53f132a452995 /lib
parentd8b8c9895b1069b6baf7a914b01d0f68930d0acf (diff)
downloadnextcloud-server-ac0c7a8fe0223c3d99d01c17302b7097defcb502.tar.gz
nextcloud-server-ac0c7a8fe0223c3d99d01c17302b7097defcb502.zip
Fix file size computation on 32bit platforms
Signed-off-by: aler9 <46489434+aler9@users.noreply.github.com>
Diffstat (limited to 'lib')
-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;