$data['etag'] = $etag;
}
}
+
+ // we only updated unencrypted_size if it's already set
+ if ($cacheData['unencrypted_size'] === 0) {
+ unset($data['unencrypted_size']);
+ }
+
// Only update metadata that has changed
$newData = array_diff_assoc($data, $cacheData->getData());
} else {
+ // we only updated unencrypted_size if it's already set
+ unset($data['unencrypted_size']);
$newData = $data;
$fileId = -1;
}
if (isset($this->unencryptedSize[$fullPath])) {
$data['encrypted'] = true;
$data['size'] = $this->unencryptedSize[$fullPath];
+ $data['unencrypted_size'] = $data['size'];
} else {
if (isset($info['fileid']) && $info['encrypted']) {
$data['size'] = $this->verifyUnencryptedSize($path, $info->getUnencryptedSize());
$data['encrypted'] = true;
+ $data['unencrypted_size'] = $data['size'];
}
}
$result = $unencryptedSize;
if ($unencryptedSize < 0 ||
- ($size > 0 && $unencryptedSize === $size)
+ ($size > 0 && $unencryptedSize === $size) ||
+ $unencryptedSize > $size
) {
// check if we already calculate the unencrypted size for the
// given path to avoid recursions