Skip to content

fix: encode uri for delete, restore and favorite - #40644

Merged
ChristophWurst merged 1 commit into
masterfrom
fix/noid/encode-uri-trashbin-restore-files-delete-favorite
Sep 29, 2023
Merged

fix: encode uri for delete, restore and favorite#40644
ChristophWurst merged 1 commit into
masterfrom
fix/noid/encode-uri-trashbin-restore-files-delete-favorite

Conversation

@kesselb

@kesselbkesselb commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

Version for stable27: #40642

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

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Conflicts mildly

@ChristophWurstChristophWurst 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 <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the fix/noid/encode-uri-trashbin-restore-files-delete-favorite branch from e5fb084 to 4f70324CompareSeptember 28, 2023 18:36
@ChristophWurst

Copy link
Copy Markdown
Member

CI failure is unrelated to the code changes

@ChristophWurst
ChristophWurst merged commit cfda046 into masterSep 29, 2023
@ChristophWurst
ChristophWurst deleted the fix/noid/encode-uri-trashbin-restore-files-delete-favorite branch September 29, 2023 06:29
@skjnldsv

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

image

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

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

Copy link
Copy Markdown
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@kesselb@ChristophWurst@skjnldsv@Pytal