dav: fix wrong decoding of pluses in URLs#40594
Merged
skjnldsv merged 1 commit intonextcloud:masterfrom Jan 31, 2024
Merged
Conversation
8 tasks
Contributor
Author
|
Pinging @icewind1991 @ArtificialOwl @fenn-cs, this has been sitting for nearly a month and is a one-liner. |
Merged
|
I had this problem that the Dav Backend lost / did not sync Files with a plus sign. I have tested this PR and it fixes it. @icewind1991 @ArtificialOwl @fenn-cs please merge this. |
skjnldsv
approved these changes
Jan 30, 2024
Member
|
/backport to stable28 |
8 tasks
PHP's urldecode function does not decode URLs according to RFC 3986, but according to the HTML 4.01 query parameter encoding. This results in pluses being wrongly decoded to spaces even though they should not be decoded at all. Use rawurldecode instead, which follows RFC 3986 properly. This fixes an issue where files on DAV shares containing pluses were incorrectly decoded to spaces. Fixes: nextcloud#15849 Signed-off-by: Lorenz Brun <[email protected]>
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
This comment was marked as resolved.
This comment was marked as resolved.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PHP's urldecode function does not decode URLs according to RFC 3986, but according to the HTML 4.01 query parameter
encoding. This results in pluses being wrongly decoded to spaces even though they should not be decoded at all.
Use rawurldecode instead, which follows RFC 3986 properly.
This fixes an issue where files on DAV shares containing pluses were incorrectly decoded to spaces.
Fixes #15849
Fixes #40943
Checklist