Commit Graph

21 Commits

Author SHA1 Message Date
Morris Jobke c44ec8c5d5
Only execute plain mimetype check for directories and do the fallback only for non-directories
Ref #23096

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-30 16:43:57 +01:00
Julius Härtl 63479684a5
Make sure to check the mimetype on the path if a secure one could not be detemined though the content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-29 16:01:50 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Arthur Schiwon 4a0926f5de
make the mime type checker for flow available to regular users
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-01-09 12:29:26 +01:00
Joas Schilling 4a151c545a
Allow to specify apps that somethign is a dir
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 09:11:43 +01:00
Joas Schilling 511a4ba66f
Improve mimetype detection in workflow components
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 09:11:43 +01:00
Joas Schilling d4d3725bfe
Only cache the mimetype if the file exists
Otherwise files access control will cache "application/octet-stream"
for all the target node on:
rename, move, copy and all other methods which create a new item

To check this:
1. Add an automated tagging rule which tags on mimetype NOT "httpd/unix-directory"
2. Add an access control rule which checks for any mimetype
3. Create a folder and rename it, the folder should not be tagged, but it is

Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-10-14 10:05:45 +02:00
Joas Schilling 744b635d5c
Correctly detect the mimetype from uploads
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-26 17:43:47 +02:00
Julius Härtl 72a7fe8185
Fix type hinting on setFileInfo
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-09-10 08:52:13 +02:00
Arthur Schiwon 4cd931fcc6
require IChecks to receive entity context
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-09 22:56:05 +02:00
Arthur Schiwon fd2de58503
seperate setFileInfo from ICheck
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-09 22:56:05 +02:00
Arthur Schiwon c2a52813e2
extends ICheck with scope and entity support, provide them as initialState
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-09 22:56:04 +02:00
Roeland Jago Douma 90dc8fb42e
A folder should get a folder mimetype
If doing achunked upload the mimetype of the folder would otherwise be
guessed from the path. Which always returned application/octet-stream.

If an access control rule to block that is in place this means that all
chunked uploads fail hard in directories as the isCreatable on the
directory always fails.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-29 21:35:08 +01:00
Joas Schilling c574212422
Fix mimetype detection for junked uploads
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-08-24 10:42:59 +02:00
Joas Schilling 394a61f1e6
Fix workflow engine mimetype detection when creating a directory
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-23 12:45:36 +01:00
Joas Schilling e8be73f485
Fix mimetype detection on public uploads for the workflow engine
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-06 12:04:54 +01:00
Joas Schilling 2d61ee3c13
Make mimetype also work for READ and DELETE operations 2016-09-05 09:48:23 +02:00
Joas Schilling d08240e364
Better detection of mimetypes while uploading a zip on a mac 2016-09-05 09:48:22 +02:00
Joas Schilling 6aa5d674d6
Translate the errors 2016-08-01 17:56:33 +02:00
Joas Schilling 8a753342ee
Add file mime type 2016-08-01 17:19:04 +02:00