aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/View.php
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2022-11-23 12:43:57 +0100
committerLouis Chemineau <louis@chmn.me>2022-11-23 12:43:57 +0100
commit66ba90ceffeccc5b2c621159e109fab6595582d7 (patch)
treeaa6917d9821a0f792e1313cec7b05abd7617ff6a /lib/private/Files/View.php
parent9422d80f882b99d56fb9edb3c7bd1f3758e9cb1f (diff)
downloadnextcloud-server-66ba90ceffeccc5b2c621159e109fab6595582d7.tar.gz
nextcloud-server-66ba90ceffeccc5b2c621159e109fab6595582d7.zip
Update cache when file size === 0
The conditions were false when $result === 0. $results here contains the number of written bits. The correct way of checking for operation success is to check if $result === false Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r--lib/private/Files/View.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 0abc870dc6f..16a9381768b 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1191,13 +1191,13 @@ class View {
throw $e;
}
- if ($result && in_array('delete', $hooks)) {
+ if ($result !== false && in_array('delete', $hooks)) {
$this->removeUpdate($storage, $internalPath);
}
- if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
+ if ($result !== false && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
$this->writeUpdate($storage, $internalPath);
}
- if ($result && in_array('touch', $hooks)) {
+ if ($result !== false && in_array('touch', $hooks)) {
$this->writeUpdate($storage, $internalPath, $extraParam);
}