Handle remote paths with special characters correctly#9341
Conversation
|
/backport to stable-4.0 |
There was a problem hiding this comment.
Pull request overview
This pull request aims to fix the handling of remote file paths that contain special characters (particularly # and ?) which are normally treated as URL delimiters. The implementation attempts to parse these characters as literal parts of file/directory names rather than as URL fragments or query parameters.
Changes:
- Modified the URL parsing logic in
FilesDatabaseManager.itemMetadata(account:locatedAtRemoteUrl:)to extract paths from raw URL strings - Added test cases for paths containing hashtags and question marks in directory names
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| FilesDatabaseManager.swift | Refactored URL parsing to treat special characters (#, ?) as literal characters in paths rather than URL delimiters |
| FilesDatabaseManagerTests.swift | Added tests for finding items in directories with hashtags and question marks in their names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...extcloudFileProviderKit/Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift
Outdated
Show resolved
Hide resolved
...extcloudFileProviderKit/Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift
Outdated
Show resolved
Hide resolved
...extcloudFileProviderKit/Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift
Show resolved
Hide resolved
97cefee to
892e232
Compare
…ctly. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
892e232 to
a69582c
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9341.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|



If files or folders contain characters with special treatment in URLs (such as
?,#or%), it may sabotage the metadata lookup because the paths were not parsed correctly yet.