Commit Graph

42 Commits

Author SHA1 Message Date
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Joas Schilling 8027dcbc6f
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +01:00
Julius Härtl 5e4303b1fe
Properly add both mimetypes to secure mimetype mapping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-07 16:42:11 +02:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +02:00
lui87kw 3fe3d1fca3 Extra white space to follow other ifs
Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
2020-07-15 10:18:47 +02:00
bladewing 7dafd5831f Avoid substr() error when strpos returns false
"Exception: substr() expects parameter 3 to be int, bool given" can occur on Line 378 $mimePart = substr($icon, 0, strpos($icon, '-'));
This happens, when '-' is not found and strpos returns false instead of an int.
When this occurs, e.g., Activity hangs.

Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
2020-07-15 10:18:47 +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 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Christoph Wurst 1b46621cd3
Update license headers for 18
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-20 09:23:25 +01:00
Roeland Jago Douma 4356c91ffd
Fix detection of non extention types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-12 09:58:22 +01:00
Joas Schilling 107ef72afb
Try more methods
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 10:56:47 +01:00
Joas Schilling da44c2a414
Some more fixes in detecting the mimetype from the content
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 09:11:42 +01:00
Joas Schilling 1336dedd5d
Cleanup the code
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 09:11:40 +01:00
Joas Schilling b92ebb928a
Allow to check for the mimetype by content only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-10 09:10:32 +01:00
Daniel Kesselberg 29575c4d36
Move custom definition logic into method
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-12-09 12:10:19 +01:00
Daniel Kesselberg 64aba49461
Ensure that we don't merge broken json.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-12-09 12:09:43 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Julius Härtl a9c089064b
Deprecate TemplateManager
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-10-16 09:54:17 +02:00
Xheni Myrtaj d227f4d34c
Do not fail integrity check if mimetype list is changed
Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
2019-05-29 22:43:23 +02:00
Joas Schilling bb352fb667
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-08 15:44:45 +01:00
Robin Appelman 5e9d6b1585
use insertIfNotExists to store new mimetypes.
Also throw an error if we can't find the mimetype after insert

Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-08-09 15:20:55 +02:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Morris Jobke 405bbc1c61
Improve mimetype detection for object storages
Object storage instances always fall back to the content based mimetype detection, because the file name for object storage was always random due to the fact that it was temporarily storage in a generated temp file. This patch adds a check before that to make sure to use the original file name for this purpose and also remove possible other extensions like the versioning or part file extension.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 16:31:59 +02:00
Robin Appelman 18908af87b
Dont swallow exception when inserting mimetypes if we're inside a transaction
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-08-26 18:58:06 +02:00
Joas Schilling 00ebd5c184
Fix variable names
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-15 12:38:30 +02:00
Joas Schilling fd75c08238
Fix order of parameter and escaping
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-12 09:33:51 +02:00
Joas Schilling 65efb388e6
Actually we want to update the mimetype of all files ending with the suffix
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-11 10:58:21 +02:00
Rello f1ef5fc537
don´t change folders with --repair-filecache
check if folder is "httpd/unix-directory" and don´t perform here #27585
2017-05-11 10:40:48 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Magnus Walbeck 3d99ec6832 Reduced code for filename trim
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
2017-01-23 17:14:39 +01:00
Magnus Walbeck eadc1ac637 Mimetype detection for hidden files
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
2017-01-23 13:28:35 +01:00
Vincent Petry 9b4de310bd
Fix mimetype detection inside hidden folders (#26138)
Downstreaming of https://github.com/owncloud/core/pull/26138

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-26 11:31:03 +02:00
Joas Schilling 24d90a4bb1
Correctly remove the charset from finfo mimetype 2016-09-05 09:48:22 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Hendrik Leppelsack 11be3d6276 remove png references in core 2016-07-01 16:36:37 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Roeland Jago Douma dedf392751
Move \OC\Files to PSR-4 2016-04-24 21:37:35 +02:00