Skip to content
Snippets Groups Projects
Unverified Commit e580f911 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #23257 from aler9/patch-32bit-filesize-master

Fix file size computation on 32bit platforms
parents 32f6bdf0 ac0c7a8f
No related branches found
No related tags found
No related merge requests found
...@@ -146,8 +146,8 @@ class Local extends \OC\Files\Storage\Common { ...@@ -146,8 +146,8 @@ class Local extends \OC\Files\Storage\Common {
public function stat($path) { public function stat($path) {
$fullPath = $this->getSourcePath($path); $fullPath = $this->getSourcePath($path);
clearstatcache(true, $fullPath); clearstatcache(true, $fullPath);
$statResult = stat($fullPath); $statResult = @stat($fullPath);
if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { if (PHP_INT_SIZE === 4 && $statResult && !$this->is_dir($path)) {
$filesize = $this->filesize($path); $filesize = $this->filesize($path);
$statResult['size'] = $filesize; $statResult['size'] = $filesize;
$statResult[7] = $filesize; $statResult[7] = $filesize;
...@@ -159,9 +159,7 @@ class Local extends \OC\Files\Storage\Common { ...@@ -159,9 +159,7 @@ class Local extends \OC\Files\Storage\Common {
* @inheritdoc * @inheritdoc
*/ */
public function getMetaData($path) { public function getMetaData($path) {
$fullPath = $this->getSourcePath($path); $stat = $this->stat($path);
clearstatcache(true, $fullPath);
$stat = @stat($fullPath);
if (!$stat) { if (!$stat) {
return null; return null;
} }
...@@ -180,6 +178,7 @@ class Local extends \OC\Files\Storage\Common { ...@@ -180,6 +178,7 @@ class Local extends \OC\Files\Storage\Common {
} }
if (!($path === '' || $path === '/')) { // deletable depends on the parents unix permissions if (!($path === '' || $path === '/')) { // deletable depends on the parents unix permissions
$fullPath = $this->getSourcePath($path);
$parent = dirname($fullPath); $parent = dirname($fullPath);
if (is_writable($parent)) { if (is_writable($parent)) {
$permissions += Constants::PERMISSION_DELETE; $permissions += Constants::PERMISSION_DELETE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment