Skip to content
Snippets Groups Projects
Commit ac0c7a8f authored by aler9's avatar aler9
Browse files

Fix file size computation on 32bit platforms

parent d8b8c989
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