Commit Graph

596 Commits

Author SHA1 Message Date
Hugo Sales 1adde913c6
[PHPStan] Only run custom PHPStan extensions if environment vairable PHPSTAN_BOOT_KERNEL is defined (since it requires having the whole social setup available) 2021-09-14 13:13:45 +01:00
Diogo Peralta Cordeiro 7c465bba5f
[NOTE] Add mimetype to notes 2021-09-14 13:13:45 +01:00
Hugo Sales c69b28d894
[CORE] Fix `Undefined array key 0` in `DB::filterTableName` 2021-09-14 13:13:45 +01:00
Hugo Sales b74d944ae3
[TOOLS][PHPStan] Raise PHPStan level to 3 and fix new errors 2021-09-14 13:13:45 +01:00
Hugo Sales f81bf4a257
[TOOLS][PHPStan] Add mechanism for initializing the whole application 2021-09-14 13:13:44 +01:00
Hugo Sales ddb9702b1c
[TOOLS][PHPStan] Add support for deducing the correct entity type from a table name. Needs refactoring and can only run inside container, as it connects to the database itself 2021-09-14 13:13:44 +01:00
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Eliseu Amaro 61071a6821
[PLUGINS][Reply][Repeat][Favourite] Base template semantic rework. Reply, repeat and favourite respective classes are now assigned in their NoteHandlerPlugin. 2021-09-14 13:13:43 +01:00
Diogo Peralta Cordeiro ddd2ffe26a
[TWIG] Add extension to check if Firefox is being used 2021-09-14 13:13:43 +01:00
Hugo Sales add8f4a52f
[TOOLS] Fix all errors found by PHPStan level 1 2021-09-14 13:13:42 +01:00
Hugo Sales 277a080d7c
[EXCEPTION] Add `NotImplementedException` 2021-09-14 13:13:42 +01:00
Hugo Sales eb833b62e2
[TOOLS] Fix all level 0 errors found by PHPStan and move constant definition to bootstrap file 2021-09-14 13:13:42 +01:00
Hugo Sales f65e2b90f2
[CORE] Fix use of `Exception` class without import 2021-09-14 13:13:41 +01:00
Hugo Sales cbbef90752
[UTIL][CONFIG] Ensure `setConfig` uses a `locals` key 2021-09-14 13:13:41 +01:00
Hugo Sales 4916c8cbda
[CONTROLLER][AdminPanel] Add missing Exception import 2021-09-14 13:13:41 +01:00
Hugo Sales e8ae0b74e0
[CORE][Controller] Switch order for content negotiation: allow events to take precedence. Bring back default JSON response 2021-09-14 13:13:41 +01:00
Hugo Sales cd89106fc0
[EXCEPTION][RedirectException] Add prevention for open redirects by default and ensure we can redirect to the same page 2021-09-14 13:13:40 +01:00
Hugo Sales 16cde6dfd7
[PLUGINS][Reply] Redirect back to previous URL on note reply. Move controller to own class
This should be safe against open redirects, as it doesn't allow redirecting to other domains
2021-09-14 13:13:40 +01:00
Hugo Sales 0a7fd9c460
[CORE][MODULES][NoteHandlerPlugin] Add missing import for `Event` 2021-09-14 13:13:40 +01:00
Hugo Sales 1d5fd1aefa
[CORE][Controller] Fix `Controller::__invoke` so it actually passes on the route parameters to the controller method. Add `Controller->string`, which gets a query parameter as a string value, or null if not set 2021-09-14 13:13:40 +01:00
Hugo Sales 330143e549
[ROUTER][DOCUMENTATION] Add `Router::isAbsolute`, add documentation to `Router::url` and `s/setRouter/serServices/ 2021-09-14 13:13:39 +01:00
Hugo Sales be27a10244
[EVENTS] Rename event `RouteInFormat` to `ControllerResponseInFormat` 2021-09-14 13:13:39 +01:00
Hugo Sales 983e0303a5
[ROUTER] Sort routes so that the one with a smaller list of Accept types matches first
This requires a copy, but gets cached, so it's the ideal place to do it.

Note that only routes that match the incoming Accept match anyway, so the order between those with different accept types is not relevant
2021-09-14 13:13:39 +01:00
Hugo Sales 45734d882c
[CONFIG] Make it possible to write module configuration in a config.{php,yml,yaml,xml} file and set each value as properties in the module object 2021-09-14 13:13:38 +01:00
Diogo Peralta Cordeiro e4aa3ae968
[NOTE] Add route and controller 2021-09-14 13:13:37 +01:00
Diogo Peralta Cordeiro fd3b57dc24
[CORE][Controller] Make it possible for plugins to add different content-types to existing routes 2021-09-14 13:13:37 +01:00
Hugo Sales 626f50080b
[MODULES] Use snake_case for module config keys 2021-09-14 13:13:37 +01:00
Hugo Sales 033c4db914
[MODULES] Add function to defer module initialization and cleanup to plugin and component. Add example in Avatar component
Forward onInitializeModule to onInitializePlugin if the component is a plugin
2021-09-14 13:13:37 +01:00
Hugo Sales bda839be7b
[MODULES] Add InitiializeModule and CleanupModule events, similar to v2 2021-09-14 13:13:37 +01:00
Diogo Peralta Cordeiro 1ee8df1494
[DOCS][Developer] Elaborate on implementing and configuring a module 2021-09-14 13:13:37 +01:00
Hugo Sales 141f919ca7
[CONFIG][TESTS] Fix error found by AdminPanel test 2021-09-14 13:13:36 +01:00
Hugo Sales c71a4b06ef
[CONFIG] Make it possible to write module configuration in a config.{php,yml,yaml,xml} file and set each value as properties in the module object 2021-09-14 13:13:36 +01:00
Hugo Sales 3587b8dc1d
[CONFIG] Refactor configuration loading 2021-09-14 13:13:36 +01:00
Hugo Sales 2fdd0b0820
[TESTS][DataFixtures] Use Temporary file instead of an ad-hoc solution to copy the upload files 2021-09-14 13:13:36 +01:00
Diogo Peralta Cordeiro 2b457655ea
[CORE] Fix path configuration 2021-09-14 13:13:35 +01:00
Diogo Peralta Cordeiro e7b985a460
[FIXTURES] Catch any exception, we don't have VIPS-related only 2021-09-14 13:13:35 +01:00
Diogo Peralta Cordeiro f9079784c4
[ENTITY][AttachmentThumbnail] Improve the way EncoderPlugins participate in the thumbnail process 2021-09-14 13:13:35 +01:00
Diogo Peralta Cordeiro bc1fb007aa
[Core][GSFile] Improve the way EncoderPlugins participate in the file sanitization process 2021-09-14 13:13:34 +01:00
Diogo Peralta Cordeiro 210f895e74
[ENTITY][Attachment] Respect rfc6838#section-4.2 mimetype length 2021-09-14 13:13:34 +01:00
Diogo Peralta Cordeiro 2a3db65216
[CONTROLLER][Attachment] Some attachments may not have dimensions 2021-09-14 13:13:34 +01:00
Hugo Sales 26bf78360b
[ROUTER][UTIL] Allow specifying the Accept format for a route 2021-09-14 13:13:34 +01:00
Hugo Sales 811caaadf9
[MODULES][PLUGINS] Move noteActionHandle utility to NoteHandlerPlugin which plugins which handle actions on notes should extend 2021-09-14 13:13:34 +01:00
Hugo Sales 458b6d0009
[UI] Rename all forms to more specific names, to avoid form name collisions 2021-09-14 13:13:33 +01:00
Hugo Sales 6af1383e07
[UTIL][Form] Disallow using very generic form names, as they can collide with other forms in the same page 2021-09-14 13:13:33 +01:00
Hugo Sales 4cd3924cc1
[ATTACHMENTS][AttachmentThumbnail] Fix implementation of predictScalingValues and small fixes 2021-09-14 13:13:32 +01:00
Hugo Sales 2ccbbd53a6
[TESTS] Add code coverage annotations to entities 2021-09-14 13:13:32 +01:00
Hugo Sales 79215bc439
[Note] Fix scope check for group notes, move away from SQL, to DQL 2021-09-14 13:13:32 +01:00
Hugo Sales e392a9c90c
[TESTS][DataFixtures] Add user, self follows, group member and group scope note 2021-09-14 13:13:32 +01:00
Hugo Sales 4b2a92d052
[UI][Attachment] Use Attachment methods to get the proper URL, rather than crafting it in a template 2021-09-14 13:13:32 +01:00
Hugo Sales 6799052ff5
[ATTACHMENTS] Ensure thumbnail dimensions are bounded and change way cropping is implemented 2021-09-14 13:13:32 +01:00