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
J0WI
3b656446af
Introduce ISecureRandom::CHAR_ALPHANUMERIC
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-07-08 15:11:31 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Lukas Reschke
a521ed874c
Remove unused constants
...
No calls in all of GitHub as per https://sourcegraph.com/search?q=USER_AGENT_OWNCLOUD_&patternType=literal
Deprecation has also been years ago.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-05-25 19:01:48 +07:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
...
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard ) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases )
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md )
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Morris Jobke
24d436cb60
Remove unneeded casts that were found by Psalm
...
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521 )
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-11 13:14:41 +07:00
Christoph Wurst
8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +07:00
Christoph Wurst
9ce3ea3368
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-30 14:07:05 +07:00
Roeland Jago Douma
adc4f1a811
Merge pull request #22916 from J0WI/unifiy-links-to-php.net
...
Unify links to php.net
2020-12-22 09:53:31 +07:00
Julius Härtl
fbbb48fcc2
Merge pull request #24730 from J0WI/fix-trusted-ipv6
...
Fix IPv6 localhost regex
2020-12-21 09:59:31 +07:00
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 +07:00
J0WI
331f30f085
Fix IPv6 localhost regex
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2020-12-16 14:37:56 +07:00
Daniel Kesselberg
8ebd31d686
Make $vars and $secureRandom required.
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-12-10 17:06:32 +07:00
Christoph Wurst
7e2c3a820e
Remove the cookie paths for php<7.3
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-11-06 15:57:17 +07:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Joas Schilling
95a301ea57
Fix tests
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-02 10:37:18 +07:00
Joas Schilling
3212c074b9
Log the number of queries built and executed
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-25 14:55:53 +07:00
J0WI
68ce17e59b
Unify links to php.net
...
Update all links to https://www.php.net/
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2020-09-17 17:40:04 +07: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 +07:00