Skip to content

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
@kesselb kesselb enabled auto-merge September 28, 2023 18:38
@ChristophWurst
Copy link
Member

CI failure is unrelated to the code changes

@ChristophWurst ChristophWurst merged commit cfda046 into master Sep 29, 2023
@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

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.

5 participants