-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External storage encryption delete error #22598
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
getId
is only available if $entry
is a instance of CacheEntry
. I would fix it like if ($entry instanceof CacheEntry) {
but a storage expert should have a look because get
should return a CacheEntry or false. An array with one or more keys is not documented.
lib/private/Files/Cache/Cache.php
Outdated
@@ -515,7 +515,8 @@ public function inCache($file) { | |||
*/ | |||
public function remove($file) { | |||
$entry = $this->get($file); | |||
|
|||
// when deleting the entry, encrypted is not save in database, so we ignore it | |||
unset($entry["encrypted"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unset($entry["encrypted"]); | |
unset($entry['encrypted']); |
Signed-off-by: xiangbin.li <dassio@icloud.com>
There should indeed not be an array returned. Would be interesting to know where that is coming from to fix that actually. While the unset might still work if false is returned I'd prefer to figure out the original source of the array and see why there is no CacheEntry returned. |
you can check the second track trace to see where this it is added by the encryption wrapper, so if encrtiption is not eabled, we will not have this issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
154 >->-$data = $query->execute()->fetch();
155
156 >->-//merge partial data
157 >->-if (!$data and is_string($file) and isset($this->partial[$file])) {
158 >->->-return $this->partial[$file];
159 >->-} elseif (!$data) {
160 >->->-return $data;
161 >->-} else {
162 >->->-return self::cacheEntryFromData($data, $this->mimetypeLoader);
163 >->-}
164 >-}
even though the query did not return anything, we still have the encrypted
data from the encryption wrapper
/rebase |
fix issue caused by d3b6dbc
Error Message:
Analysis
File Upload
the metadata
encrypted
is not savedFile Delete
when deleting file, 'encrypted' is added, so it pass condition check
if ($entry) {
, result in the error