Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

icewind1991
Copy link
Member

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.

… store

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Sep 13, 2023
@icewind1991 icewind1991 added this to the Nextcloud 28 milestone Sep 13, 2023
@icewind1991 icewind1991 requested review from a team, ArtificialOwl, Fenn-CS and sorbaugh and removed request for a team September 13, 2023 14:37
@icewind1991
Copy link
Member Author

/backport to stable27

@icewind1991
Copy link
Member Author

/backport to stable26

@icewind1991
Copy link
Member Author

/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);
Copy link
Contributor

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.

Comment on lines 213 to 214
$targetExtension = pathinfo($target, PATHINFO_EXTENSION);
$targetIsTrash = preg_match("/d\d+/", $targetExtension);
Copy link
Contributor

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?

@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Feb 23, 2024
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv removed this from the Nextcloud 29 milestone Mar 28, 2024
@skjnldsv skjnldsv added this to the Nextcloud 30 milestone Mar 28, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants