This is not correct. Hence in this patch we validate
if the mimetype is 'httpd/unix-directory'. If so we
don't disable it.
This patch addresses solution for issue: 26034
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
Often a route.php file will have many N routes but only M controllers.
Where N >= M. Which means that in most cases the ControllerName will be
converted multiple times. This is of course far from ideal.
Note that this is per app so the cache will contain at most N entries.
Which is not to bad.
In getMountPointNode function rootId is not inside of the userFolder for home storage. We was searching '/user' folder in '/user/files' folder. So, it was return NULL. I moved searching part to parent folder. It solves everything. Also, obviously other storage types not affect then this change.
Related owncloud commit :
https://github.com/owncloud/core/pull/26017
* put a file without a generated preview in the trashbin
(e.g. a *.docx file)
* open the trashbin
* following errors will show up in the nextcloud.log:
- filesize(): stat failed for ...
- fopen(...): failed to open stream: No such file or directory at ...
- fread() expects parameter 1 to be resource, boolean given at ...
- fclose() expects parameter 1 to be resource, boolean given at ...
- imagecreatefromstring(): Empty string or invalid image at ...
This is because the preview code tries to load an SVG image, which
is obviously only text.
The fix simply handles this before the loading happens and the web UI
keeps showing the default mimetype icon.
The exception message is potentially influenced by user input and could thus be confusing (e.g. somebody could try to open a file like "Please send a mail to support@foo.com", and then the message would include that string.
It is thus reasonable to not show the exception message by default. Also for the browser view I added an `exit()` at the end, as otherwise the XML exception would be attached.
Some user agents are notorious and don't really properly follow HTTP
specifications. For those, have an automated opt-out. Since the protection
for remote.php is applied in base.php as starting point we need to opt out
here.