only update the cache if the storage operation succeeds

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-12-02 16:20:49 +01:00
parent 6c1278c1cc
commit d84f88b041
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
1 changed files with 3 additions and 3 deletions

View File

@ -1128,13 +1128,13 @@ class View {
throw $e;
}
if (in_array('delete', $hooks) and $result) {
if ($result && in_array('delete', $hooks) and $result) {
$this->removeUpdate($storage, $internalPath);
}
if (in_array('write', $hooks) and $operation !== 'fopen') {
if ($result && in_array('write', $hooks) and $operation !== 'fopen') {
$this->writeUpdate($storage, $internalPath);
}
if (in_array('touch', $hooks)) {
if ($result && in_array('touch', $hooks)) {
$this->writeUpdate($storage, $internalPath, $extraParam);
}