]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update cache when file size === 0 35367/head
authorLouis Chemineau <louis@chmn.me>
Wed, 23 Nov 2022 11:43:57 +0000 (12:43 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Wed, 23 Nov 2022 15:04:34 +0000 (15:04 +0000)
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>
lib/private/Files/View.php

index a909cf467695ce0c773e3d8a49cc814b580196ff..299f1e3df9952e6200398ea58c7d94f8e82aea63 100644 (file)
@@ -1195,13 +1195,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);
                                }