mirror of
https://github.com/nextcloud/server.git
synced 2026-04-25 16:19:06 -04:00
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>
This commit is contained in:
parent
6d566367a9
commit
cb99a5795d
1 changed files with 3 additions and 3 deletions
|
|
@ -1189,13 +1189,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue