Commit Graph

127 Commits (b42d26b42f5ef5a4fe05af719f1183c20cb43414)

Author SHA1 Message Date
Joas Schilling 1909b981a4
fix(controller): Fix false booleans in multipart/form-data
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-11-28 12:18:30 +07:00
provokateurin dd0ed02b91
feat(Dispatcher): Add debug log for controller methods returning raw data not wrapped in Response
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-11-15 10:09:59 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Ferdinand Thiessen c82b17d0a3
fix: Support Safari mobile
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-21 13:01:23 +07:00
provokateurin 9d1705259c
fix(AppFramework): Allow requests with OCS-APIRequest header to pass CSRF checks
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-25 17:31:49 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Côme Chilliet 672923f0a6
fix: Fix newly spotted psalm issues, add exhaustive typed magic properties for LDAP classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-30 09:23:58 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Julius Härtl b8c5bff673
fix: Adjust user agent pattern for Edge
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-03-08 12:11:46 +07:00
Joas Schilling 696ed4a125
fix(CS): Fix coding style
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-02-14 15:38:15 +07:00
Joas Schilling c4684089a8
fix(request): Fix regex handling and coding-style
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-02-13 16:51:13 +07:00
Mikael Peigney ffcadf25d4
fix(request): Handle reverse proxy setting a port in Forwarded-For
Signed-off-by: Mikael Peigney <Mika56@users.noreply.github.com>
2024-02-13 16:51:13 +07:00
Côme Chilliet f73f966c98 chore: Add missing ArrayAccess template parameters
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-06 10:24:41 +07:00
Ferdinand Thiessen 85978593fe
Merge pull request #42794 from nextcloud/fix/invalid-trusted-proxies
fix(Request): Catch exceptions in `isTrustedProxy`
2024-01-29 16:19:51 +07:00
Pavel Kryl 30ad530814 code style: ommited space, reverted [code review] 2024-01-27 15:11:26 +07:00
Pavel Kryl 446ecbc454 fixing bug #6914: Config Param 'overwritecondaddr' not working
- just ignoring/removing extra parameter 'protocol' as suggested by
  blizzz

Signed-off-by: Pavel Kryl <pavel@kryl.eu>
2024-01-27 15:11:26 +07:00
Ferdinand Thiessen 7620d230df
fix(Request): Catch exceptions in `isTrustedProxy`
The function fails if the configured trusted proxies contain invalid characters and the underlying IpUtils will throw.
But as it is used by `getRemoteAddress` which is used by logging / templating, thrown errors are not reported but silently fail with error 500.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-01-27 14:59:51 +07:00
Joas Schilling f6b6776c93
fix(API): Use a distinct exception so apps can react to it and customize the return
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-28 06:11:57 +07:00
Arthur Schiwon 3fa43a529b
enh(dispatcher): enforce psalm ranges in the http dispatcher
- allows devs to provide int ranges for API arguments

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-11-24 12:46:38 +07:00
Joas Schilling aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Joas Schilling 2fa78f6245
Reverse X-Forwarded-For list to read the correct proxy remote address
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-16 07:45:19 +07:00
Hamid Dehnavi ea06cf2f39 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 17:44:19 +07:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +07:00
Côme Chilliet 426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +07:00
Julius Härtl dc3916e27c
fix: Only get params from PUT content if possible
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-03 22:30:04 +07:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +07:00
Christoph Wurst 20fcfb5739
feat(app framework)!: Inject services into controller methods
Usually Nextcloud DI goes through constructor injection. This has the
implication that each instance of a class builds the full DI tree. That
is the injected services, their services, etc. Occasionally there is a
service that is only needed for one controller method. Then the DI tree
is build regardless if used or not.

If services are injected into the method, we only build the DI tree if
that method gets executed.

This is also how Laravel allows injection.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-01-18 14:00:38 +07:00
Joas Schilling 0af4e9d4fe
Merge pull request #34172 from audriga/add-scim-json-support
Add support for application/scim+json
2022-12-20 08:58:33 +07:00
Côme Chilliet cf508c1e47 Use strict typing in base.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 09:10:40 +07:00
Stanimir Bozhilov 7dcd6eb561
Merge branch 'master' into add-scim-json-support
Signed-off-by: Stanimir Bozhilov <stanimir.bozhilov.1998@gmail.com>
2022-12-19 09:07:38 +07:00
Vincent Petry ae6fe874ed
Merge pull request #35780 from nextcloud/fix/http-dispatcher-double-parameter-cast
Fix missing cast of double controller parameters
2022-12-16 16:18:35 +07:00
Christoph Wurst b6dd1a1d7b
fix(app framework): Fix missing cast of double controller parameters
``settype`` allows 'double' as alias of 'float'.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-12-15 09:33:52 +07:00
Artur Neumann 81f2857f34
check if params given to API are really an array
Signed-off-by: Artur Neumann <artur@jankaritech.com>
2022-12-15 13:45:22 +07:00
Stanimir Bozhilov b44befa881 Move JSON content type regex to IRequest and make it a const 2022-12-08 15:11:23 +07:00
Stanimir Bozhilov 46c10c77e1 Fix the JSON content type regex to match all MIME types
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
2022-09-26 11:51:44 +07:00
Stanimir Bozhilov d80f8f6c82 Type hint JSON content type regex and use preg_match less
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
2022-09-22 11:25:39 +07:00
Stanimir Bozhilov f286a9d6ac Use regex for all JSON-related content types
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
2022-09-21 16:36:01 +07:00
Stanimir Bozhilov 0ace70488a Treat application/json and application/scim+json in same if-block
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
2022-09-21 15:31:50 +07:00
Stanimir Bozhilov f0dbe1148a Add support for application/scim+json content type
Signed-off-by: Stanimir Bozhilov <stanimir@audriga.com>
2022-09-20 16:18:52 +07:00
Simon Leiner 09362eaeaa
Support specifying IPv6 proxies in CIDR notation
Previously, it was not possible to use CIDR notation for IPv6 proxies
in the trusted_proxies parameter of config.php [1]. This patch adds
support for that.

[1]: https://docs.nextcloud.com/server/24/admin_manual/configuration_server/reverse_proxy_configuration.html#defining-trusted-proxies

Signed-off-by: Simon Leiner <simon@leiner.me>
2022-08-02 17:36:47 +07:00
luz paz 368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 +07:00
Côme Chilliet de5b7f260f
Trying without the use
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 11:10:00 +07:00
Côme Chilliet 9132ed8ef1
Use sabre function directly rather than duplicating it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 11:10:00 +07:00
Joas Schilling 0acd4b5f82
Merge pull request #31235 from nextcloud/techdebt/noid/extract-request-id
Extract request id handling to dedicated class so it can be injected without DB dependency
2022-03-22 12:08:45 +07:00
Julius Härtl 0f33453610
Diagnostics event logging to Nextcloud log
Signed-off-by: Julius Härtl <jus@bitgrid.net>

Add config samples

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-02-28 11:24:40 +07:00
Joas Schilling 07a9f34385
Extract request id handling to dedicated class so it can be injected manually
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-23 11:01:58 +07:00
Carl Schwan 6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +07:00
Côme Chilliet 113756db30
Fix ArrayAccess and JsonSerializable return types
First round of modifications for PHP 8.1

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:56 +07:00
Carl Schwan e1c4b648d1
Improve syntax error reporting
In some cases the error information is not enough to debug it.

Before:

syntax error, unexpected '<<' (T_SL)
/var/www/html/lib/private/AppFramework/Http/Dispatcher.php
158

After:

syntax error, unexpected '<<' (T_SL) in file '/var/www/html/apps/groupfolders/lib/Mount/GroupFolderStorage.php' line 88
/var/www/html/lib/private/AppFramework/Http/Dispatcher.php
158

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-09-21 10:28:26 +07:00