-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(trashbin): Truncate long filenames #38355
Conversation
} | ||
self::move($rootView, $owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . $filename . '.v' . $v['version'] . '.d' . $timestamp); | ||
self::move($rootView, $owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . static::getTrashFilename($filename . '.v' . $v['version'], $timestamp)); |
Check notice
Code scanning / Psalm
PossiblyFalseOperand
} | ||
self::move($rootView, $owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . $filename . '.d' . $timestamp); | ||
self::move($rootView, $owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . static::getTrashFilename($filename, $timestamp)); |
Check notice
Code scanning / Psalm
PossiblyFalseOperand
@@ -561,7 +562,7 @@ | |||
} elseif ($versions = self::getVersionsFromTrash($versionedFile, $timestamp, $user)) { | |||
foreach ($versions as $v) { | |||
if ($timestamp) { | |||
$rootView->rename($user . '/files_trashbin/versions/' . $versionedFile . '.v' . $v . '.d' . $timestamp, $owner . '/files_versions/' . $ownerPath . '.v' . $v); | |||
$rootView->rename($user . '/files_trashbin/versions/' . static::getTrashFilename($versionedFile . '.v' . $v, $timestamp), $owner . '/files_versions/' . $ownerPath . '.v' . $v); |
Check notice
Code scanning / Psalm
PossiblyFalseOperand
@Pytal why not increase the table lenght instead? |
Common file system limits 🤷♂️ |
Looks good but could really use some tests |
8e0cf8a
to
f51f9ab
Compare
f51f9ab
to
0a1fe5c
Compare
Signed-off-by: Christopher Ng <chrng8@gmail.com>
0a1fe5c
to
7c430a8
Compare
Fixed tests! |
/backport to stable27 |
/backport to stable26 |
/backport to stable25 |
/backport to stable24 |
/backport to stable20 |
The backport to stable25 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable25
git pull origin/stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable24 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable24
git pull origin/stable24
# Create the new backport branch
git checkout -b fix/foo-stable24
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable24 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable20 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable20
git pull origin/stable20
# Create the new backport branch
git checkout -b fix/foo-stable20
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable20 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport to stable25 |
/backport to stable24 |
/backport to stable20 |
The backport to stable20 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable20
git pull origin/stable20
# Create the new backport branch
git checkout -b fix/foo-stable20
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable20 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
See nextcloud/server#38355 for further context. Signed-off-by: Jonas <jonas@freesources.org>
See nextcloud/server#38355 for further context. Signed-off-by: Jonas <jonas@freesources.org>
See nextcloud/server#38355 for further context. Signed-off-by: Jonas <jonas@freesources.org>
Summary
Truncate filenames longer than the 250 char limit of the oc_filecache
name
column to fix deletion of files with names that would exceed 250 chars when appended with the 12 char timestamp suffixCharacters are removed from the middle of the string rather than the end due to dependencies on the embedded timestamp string which if truncated would throw trashbin errors
TODO
Checklist