-
-
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
fix mimetype not being updated when changing file extention on objectstore #40394
base: master
Are you sure you want to change the base?
Conversation
… store Signed-off-by: Robin Appelman <[email protected]>
/backport to stable27 |
/backport to stable26 |
/backport to stable25 |
@@ -194,6 +194,10 @@ public function renameFromStorage(IStorage $sourceStorage, $source, $target) { | |||
|
|||
$sourceInfo = $sourceCache->get($source); | |||
|
|||
$sourceExtension = pathinfo($source, PATHINFO_EXTENSION); | |||
$targetExtension = pathinfo($target, PATHINFO_EXTENSION); | |||
$targetIsTrash = preg_match("/d\d+/", $targetExtension); |
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.
Seems fragile, shouldn’t this test if target is in files_trashbin instead?
Or at least have a regex with ^
or $
, not something that can match anything in the middle.
https://www.file-extension.info/format/d3d This format for instance would match the regex while not being trash.
$targetExtension = pathinfo($target, PATHINFO_EXTENSION); | ||
$targetIsTrash = preg_match("/d\d+/", $targetExtension); |
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.
This is now done twice?
With object store the source entry no longer exists once we hit the updater, so the old code path for changing the mimetype wasn't triggered.