-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Describe the bug
If Markdown-Files (especially Readme.md) contain data: URLs, a http(s) request for the preview (including data) is executed, trying to get the the image preview.
https://example.com/core/preview.png?file=%2Fdata%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII%3D&x=1024&y=1024&a=true
This triggers (sometimes, if data is long enough) a "OCP\Files\InvalidPathException: Path length(7565) exceeds max path length(4000)" in the log.
Because there is no such image on the http(s) server, there is a 404 result and it will replaced with a placeholder, linked to the correct original data: - url. Clicking the placeholder opens the image in new tab.
To Reproduce
Steps to reproduce the behavior:
- Create a Readme.md file with the content
 - Close and Reopen the file in text
Expected behavior
The image is displayed correctly (or at least not requested via http(s)).
Client details:
- OS: Win 10
- Browser: Firefox
- Version: 91
- Device: PC
Server details
Text app version: 3.1.0
Operating system: Debian 10
Web server: Apache
Database: MariaDB
PHP version: 7.3
Nextcloud version: 20.0.11
Logs
Nextcloud log (data/nextcloud.log)
if data is long enough, a OCP\Files\InvalidPathException: Path length(7565) exceeds max path length(4000) - Exception (but this is correct)
Browser log
The javascript console log:
GET https://example.com/core/preview.png?file=/data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=&x=1024&y=1024&a=true
[HTTP/1.1 404 Not Found 413ms]