-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
dav: fix wrong decoding of pluses in URLs #40594
Conversation
Pinging @icewind1991 @ArtificialOwl @fenn-cs, this has been sitting for nearly a month and is a one-liner. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
/backport to stable28 |
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 |
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