aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraler9 <46489434+aler9@users.noreply.github.com>2020-10-07 13:50:29 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-12-02 15:27:22 +0000
commit349f7548335f7e062c7fd6f5103576d457a79f40 (patch)
tree406517fe2d5a175a5d94a995ec260bba41bf3a7f
parent32b7a0e13ff3527c35642ef5ba33808420e17849 (diff)
downloadnextcloud-server-349f7548335f7e062c7fd6f5103576d457a79f40.tar.gz
nextcloud-server-349f7548335f7e062c7fd6f5103576d457a79f40.zip
Fix file size computation on 32bit platforms
Signed-off-by: aler9 <46489434+aler9@users.noreply.github.com>
-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 552e996b90b..423de64acb1 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -145,8 +145,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;
@@ -158,9 +158,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;
}
@@ -179,6 +177,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;