Repository navigation
Description
Describe the bug
XML-1.0-invalid characters from a Readme.md file are directly put into the response of an rich-workspace request. Which then makes its way into iOS app and breaks its parser. It then stops listing the directory entirely nextcloud/ios#4041 .
iOS side should probably not fall on its face entirely upon failing to parse the said XML but that can be tracked on nextcloud/ios#4041 while this issue focuses on the serverside.
A server side fix proposal is at https://github.com/alpsayin/nextcloud-app-text/tree/fix/rich-workspace-invalid-xml-chars . It's AI authored, and I've seen and reviewed the code (there's a "BUT", carry on reading).
It has been tested on my own NC33 and some of the unit tests but I lack the infrastructure to run the suite asked by the contribution guidelines. As much as I'm a software engineer, I'm an embedded FW engineer who also lacks PHP and Nextcloud knowledge so I refrain from raising a PR myself.
To Reproduce
Steps to reproduce the behavior:
- Grab the attachment from No files here error with nextcloud app 33 ios#4041 (comment) put it into an account's as
Templates/Readme.md. Don't leave thetxtextension. - Refresh the top level directory listing in iOS app.
- See the listing momentarily show and disappear until the Readme.md is removed.
- Or without the iOS app (the request is a reduced version of what the iOS app sends):
With the corrupted Readme.md present, the server answers HTTP 207 but the body is not well-formed:
curl -s -u <user>:<app-password> -X PROPFIND -H 'Depth: 1' -H 'Content-Type: application/xml' \ --data '<?xml version="1.0"?><d:propfind xmlns:d="DAV:" xmlns:nc="http://nextcloud.org/ns"><d:prop><d:displayname/><nc:rich-workspace/></d:prop></d:propfind>' \ https://<server>/remote.php/dav/files/<user>/ | xmllint --noout -
-:14: parser error : PCDATA invalid Char value 22 -:14: parser error : PCDATA invalid Char value 28 -:14: parser error : PCDATA invalid Char value 16
Expected behavior
- Top level listing to show.
Screenshots
Somewhat applicable but it's just be a screenshot of no folders and files vs. a proper listing.
Server details:
- Nextcloud version: 33.0.10 (Text app 7.0.1). Also reported on NC31/NC32 and on NC34.0.4 (AIO) in No files here error with nextcloud app 33 ios#4041
- PHP Version: 8.3 (php-fpm, Apache 2.4.58)
- Database: MariaDB 10.11.14
Client details:
- OS: iOS 26.x
- Browser: N/A, Nextcloud iOS app 35.2.2.0. Web, desktop and Android clients are not affected.
- Browser version: N/A
- Device: iPhone 12 mini. Also reported on other iPhones and iPad in No files here error with nextcloud app 33 ios#4041
Logs
Nextcloud log (data/nextcloud.log)
Nothing relevant is logged, even at loglevel 0 (debug). Over the hours when the iOS Files tab was empty, nextcloud.log has ~4,400 entries from the iOS app, all routine debug noise (IServerContainer deprecation, config lexicon notices, preview cache misses). There are no errors, nothing from the text app, and nothing about rich-workspace or XML. The server answers the PROPFIND with HTTP 207. The problem is only visible in the response body, which is malformed XML because the raw Readme.md content inside <nc:rich-workspace> contains bytes 0x10/0x16/0x1c
Browser log
Not applicable: iOS app (Nextcloud iOS 35.2.2.0). The iOS app's own debug log showed nothing either; the request "succeeds" and the listing is simply empty.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields☑️ Done
Activity
[-]XML-invalid characters break rick-workspace xml parsers in iOS client[/-][+]XML-invalid characters break rich-workspace xml parsers in iOS client[/+]fix(workspace): replace XML-invalid characters in rich workspace content