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: encode uri for delete, restore and favorite #40644

Conversation

kesselb
Copy link
Contributor

@kesselb kesselb commented Sep 26, 2023

Summary

To encode # and other characters properly

Similar to #39842 but different ;)

# is a valid character for our filenames but also for uris in general and therefore not encoded by default.
To use # in filenames we need to encode it.

TODO

  • CI
  • Review

Checklist

@kesselb
Copy link
Contributor Author

kesselb commented Sep 26, 2023

Version for stable27: #40642

@kesselb kesselb self-assigned this Sep 26, 2023
@kesselb kesselb added bug 3. to review Waiting for reviews labels Sep 26, 2023
@kesselb kesselb added this to the Nextcloud 28 milestone Sep 26, 2023
@kesselb kesselb force-pushed the fix/noid/encode-uri-trashbin-restore-files-delete-favorite branch 2 times, most recently from 588234c to e5fb084 Compare September 26, 2023 14:58
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@ChristophWurst
Copy link
Member

Conflicts mildly

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 28, 2023
To encode # and other characters properly

Signed-off-by: Daniel Kesselberg <[email protected]>
@kesselb kesselb force-pushed the fix/noid/encode-uri-trashbin-restore-files-delete-favorite branch from e5fb084 to 4f70324 Compare September 28, 2023 18:36
@ChristophWurst
Copy link
Member

CI failure is unrelated to the code changes

@ChristophWurst ChristophWurst merged commit cfda046 into master Sep 29, 2023
38 checks passed
@ChristophWurst ChristophWurst deleted the fix/noid/encode-uri-trashbin-restore-files-delete-favorite branch September 29, 2023 06:29
@skjnldsv
Copy link
Member

skjnldsv commented Oct 3, 2023

UI is broken and show lots of encoded files now :)
Reverting this in followup. The data model should NOT include encoded string, it should not be request-aware. A Node object contains raw data and should never be transformed/oriented towards a specific usage (here a request context for example)

@skjnldsv
Copy link
Member

skjnldsv commented Oct 3, 2023

image

Come on folks who approved, have any of you actually tested this PR ?....
@ChristophWurst @Pytal

@@ -46,7 +46,7 @@ const resultToNode = function(node: FileStat): File | Folder {

const nodeData = {
id: node.props?.fileid as number || 0,
source: generateRemoteUrl('dav' + rootPath + node.filename),
source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encodePath is no even defined here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants