diff options
-rw-r--r-- | lib/private/Files/View.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index bbad24d3e43..56608994c01 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1222,9 +1222,16 @@ class View { $this->removeUpdate($storage, $internalPath); } if ($result !== false && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { - $isCreateOperation = $operation === 'mkdir' || ($operation === 'file_put_contents' && in_array('create', $hooks, true)); - $sizeDifference = $operation === 'mkdir' ? 0 : $result; - $this->writeUpdate($storage, $internalPath, null, $isCreateOperation ? $sizeDifference : null); + if ($operation === 'mkdir') { + $sizeDifference = 0; + } else if ($operation === 'file_put_contents' && in_array('create', $hooks, true)) { + $sizeDifference = $result; + } else { + $cacheData = $storage->getCache()->get($path); + $sizeDifference = $cacheData === false ? null : null;//$result - $cacheData->getSize(); + } + + $this->writeUpdate($storage, $internalPath, null, $sizeDifference); } if ($result !== false && in_array('touch', $hooks)) { $this->writeUpdate($storage, $internalPath, $extraParam, 0); |