Skip to content
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

Invalid response from trashbin api when filename contains invalid unescaped characters #1309

Closed
dpakach opened this issue Mar 16, 2020 · 2 comments
Labels
Category:Defect Existing functionality is not working as expected Type:Bug

Comments

@dpakach
Copy link
Contributor

dpakach commented Mar 16, 2020

Steps to reproduce

  1. Create a file with & character in its name for eg. strängé filename (duplicate owncloud/ocis-reva#2 &).txt.
  2. Delete the file
  3. Use Propfind request on trashbin api to get files in trashbin
    curl -X PROPFIND http://localhost:9140/remote.php/dav/trash-bin/<user> -u <user>:<password>

Expected result

The response should contain following content

    <d:response>
        <d:href>/core/remote.php/dav/trash-bin/user1/2147501701/2147501715</d:href>
        <d:propstat>
            <d:prop>
                <oc:trashbin-original-filename>strängé filename (duplicate owncloud/ocis-reva#2 &amp;).txt</oc:trashbin-original-filename>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>

Actual result

The response contains following invalid format

    <d:response>
        <d:href>/remote.php/dav/trash-bin/str%C3%A4ng%C3%A9%20filename%20%28duplicate%20%232%20&amp;%29.txt.d1584332791</d:href>
        <d:propstat>
            <d:prop>
                <oc:trashbin-original-filename>strängé filename (duplicate owncloud/ocis-reva#2 &).txt</oc:trashbin-original-filename>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop></d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>

diff

    <d:response>
        <d:href>/remote.php/dav/trash-bin/str%C3%A4ng%C3%A9%20filename%20%28duplicate%20%232%20&amp;%29.txt.d1584332791</d:href>
        <d:propstat>
            <d:prop>
-                 <oc:trashbin-original-filename>strängé filename (duplicate owncloud/ocis-reva#2 &).txt</oc:trashbin-original-filename>
+                 <oc:trashbin-original-filename>strängé filename (duplicate owncloud/ocis-reva#2 &amp;).txt</oc:trashbin-original-filename>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop></d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@refs
Copy link
Member

refs commented Jan 19, 2021

can confirm it still happens in the latest master. XML Renders need to be escaped. Pinging @butonic since a revamp of the entire XML rendering is due date.

@refs refs added Category:Defect Existing functionality is not working as expected Type:Bug labels Jan 19, 2021
@refs refs changed the title Invalid response from trashbin api when filename contains & Invalid response from trashbin api when filename contains invalid characters Jan 19, 2021
@refs refs changed the title Invalid response from trashbin api when filename contains invalid characters Invalid response from trashbin api when filename contains invalid unescaped characters Jan 19, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@C0rby
Copy link
Contributor

C0rby commented Apr 9, 2021

Was fixed.

@C0rby C0rby closed this as completed Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Defect Existing functionality is not working as expected Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants