Commit Graph

379 Commits

Author SHA1 Message Date
Hugo Sales ded9c86054
[CORE][DB] Add DB::refetch, which refetches an entity from the database, so it's managed and definitely up to date (use when wanting to update entities from cache) 2022-03-31 03:29:31 +01:00
Hugo Sales 20e07c9140
[CORE][DB] Make DB::dql return an object rather than an array if limit 1 is specified 2022-03-31 03:29:31 +01:00
Diogo Peralta Cordeiro 83599ef866
[CORE][Modules][Plugin] version should be static 2022-03-28 23:54:18 +01:00
Hugo Sales dac94f53cd
[CORE][Entity] Rename createOrUpdate to 'checkExistingAndCreateOrUpdate', remove update feature from 'create' and add 'createOrUpdate' and fix users 2022-03-28 20:59:15 +01:00
Hugo Sales 483983790a
[CORE][Router] Rename \App\Core\Router\Router to \App\Core\Router and merge \App\Core\Router\RouteLoader with \App\Core\Router 2022-03-28 20:59:15 +01:00
Hugo Sales 60af9f5e9b
[CORE][Queue] Rename App\Core\Queue\Queue to App\Core\Queue 2022-03-28 20:59:15 +01:00
Hugo Sales abe35428da
[CORE][DB] Rename App\Core\DB\DB to App\Core\DB 2022-03-28 20:59:14 +01:00
Diogo Peralta Cordeiro 259d2da05a
[CORE][Controller] Add default handler for when using http methods 2022-03-23 13:23:43 +00:00
Diogo Peralta Cordeiro 20f690c532
[TESTS] Fix a couple of issues from last changes 2022-03-14 18:37:39 +00:00
Diogo Peralta Cordeiro 888c3798b7
[COMPONENT][Notification] Make logic more generic and robust
Fixed various bugs

Some important concepts to bear in mind:

* Notification: Associated with activities, won't be reconstructed
together with objects, can be thought of as transient

* Attention: Associated with objects, will be reconstructed with them, can
be thought as persistent

* Notifications and Attentions have no direct implications.

* Mentions are a specific form of attentions in notes, leads to the creation of Attentions.

Finally,

Potential PHP issue detected and reported: https://github.com/php/php-src/issues/8199
`static::method()` from a non static context (such as a class method) calls `__call`, rather than
the expected `__callStatic`. Can be fixed by using `(static fn() => static::method())()`, but the
usage of the magic method is strictly unnecessary in this case.
2022-03-14 11:37:09 +00:00
Hugo Sales e1cceac150
[CORE][Form][TESTS] Fix FormTest::handle 2022-03-13 18:53:53 +00:00
Hugo Sales 1d8bba3949
[TESTS][MODULES] Move Test Fixtures to tests/fixtures folder and add support for loading fixtures from components and plugins 2022-03-13 18:00:21 +00:00
Hugo Sales 18864ca9fa
[CONTROLLER][Security] Override the `_next` form field in Security->register to redirect to login page 2022-03-13 16:01:51 +00:00
Diogo Peralta Cordeiro d8108dbc32
[COMPONENT][Posting] Fix request handling issues that resulted from splitting creation and controller 2022-03-13 15:52:48 +00:00
Hugo Sales 5c708af272
[CORE][Form] Remove unweildy return of form errors from Form::handle 2022-03-13 14:19:56 +00:00
Hugo Sales 9a9eed1457
[CORE][Router][Form] Add Router::sanitizeLocalURL and use it in Form::forceRedirect 2022-03-09 20:51:42 +00:00
Hugo Sales f540711948
[CORE][GNUsocial] Remove Session parameter, as it's no longer a service. Use session from Request 2022-03-09 20:51:42 +00:00
Hugo Sales 301421ea15
[SECURITY][EVENT] Remove deprecated uses of Symfony Guard. Add LoginSucess and LoginFailure events 2022-03-09 20:51:16 +00:00
Diogo Peralta Cordeiro 28453c585f
[COMPONENT][Attachment][TESTS] Fix Entity/AttachmentThumbnailTest 2022-03-09 01:42:11 +00:00
Diogo Peralta Cordeiro 47f03d4c9f
[COMPONENT][Attachment][TESTS] Fix Entity/AttachmentTest 2022-03-09 01:42:06 +00:00
Hugo Sales 46de2d47e9
[TOOLS] Add explicit return types to fix deprecation warnings raised by PHPUnit 2022-03-09 01:37:10 +00:00
Hugo Sales 6ddc176faf
[CORE][Form] Add facilities for automattically adding a _next field to all forms, which can be customized by the in Form::create and defaults to the current URL. Usage of RedirectedException should mostly be replaced with Form::forceRedirect 2022-03-07 15:26:26 +00:00
Diogo Peralta Cordeiro 6fa5ec3218
[CORE][Queue] Fix some minor issues 2022-03-05 14:22:44 +00:00
Hugo Sales 7a8d67f1e2
[CORE][Controller] Fix bug where a JSON request could not recieve a redirect response 2022-03-04 15:14:05 +00:00
Hugo Sales 94449c9153
[CORE][Form] Add facilities for automattically adding a _next field to all forms, which can be customized by the in Form::create and defaults to the current URL. Usage of RedirectedException should mostly be replaced with Form::forceRedirect 2022-03-04 15:12:35 +00:00
Hugo Sales f73e9c12ba
[CORE][I18n] Add I18n::_m_list, which formats an array of elements into a list. Limited to 5 elements, as that should be enough (tm) and ICU doesn't support this natively 2022-03-01 13:45:40 +00:00
Hugo Sales 4cc4d06b11
[CORE][Cache] Fix bug where empty lists must be stored as a string in Redis (not supported natively), so we can't directly push to it, but the key still exists 2022-03-01 11:07:21 +00:00
Hugo Sales 85ce6bfd41
[CORE][Cache] Add getListPartialCache, which allows for fetching a list and backing only a portion of it in the cache (useful for feeds and replies to notes, for instance) 2022-02-28 15:47:38 +00:00
Hugo Sales 45c7888676
[TOOLS] Run CS-Fixer on whole project 2022-02-28 15:47:37 +00:00
Hugo Sales 5188a473d0
[TOOLS] Fix errors reported by PHPStan 2022-02-28 15:47:37 +00:00
Diogo Peralta Cordeiro d4c908c194
[CORE][Cache] Implement listPushRight 2022-02-27 00:44:23 +00:00
Diogo Peralta Cordeiro 05b7f2c28b
[CORE][DB] Remove doc from deprecated DB::merge and add about DB::refresh 2022-02-23 17:42:20 +00:00
Diogo Peralta Cordeiro 51cccd0155
[PLUGIN][ActivityPub] Simplify DB usage 2022-02-20 05:03:40 +00:00
Eliseu Amaro e70acd5c3b
[UTIL][HTML] HTML abstraction class was extended with a more specialised Heading class
This little abstraction layer made it a bit easier to add a different title to a Note or Actor Feed Collection template, from whichever controller that uses it. Please, bear in mind, that abstract templates such as those found in Components\Collection, may act in a very 'declarative' way upon using them. This makes it difficult to dynamically choose what type of header is used without undergoing a mining operation in the likes of a pyramid of doom. Hence, this _little_ change.
2022-02-16 18:53:08 +00:00
Diogo Peralta Cordeiro f66e178dfc
[CORE][Actor][Settings] Fix nickname change and refactor Core Form::handle so it's harder to repeat these mistakes again
Minor improvements on actor->getLocal
2022-02-16 18:53:07 +00:00
Diogo Peralta Cordeiro 66323c5a73
[PLUGIN][ActivityPub] Fix several issues with target and notifications inserted by AP 2022-02-13 23:14:59 +00:00
Diogo Peralta Cordeiro 62bf788b90
[CORE][Note] Implement private group scope properly 2022-02-13 23:14:59 +00:00
Diogo Peralta Cordeiro fb3e900b28
[CORE] Add CONFIG_ prefix to environment whitelist
Fixed minor issues with Commong:config of env not being included and ported to local social yaml

Fixed some regressions introduced with [CORE] Unset sensitive information from the environment
2022-02-11 10:05:58 +00:00
Bruno Aleixo fb76775716 [TOOLS][COMPONENTS][CORE] Ran cs-fixer on all files 2022-01-30 16:41:54 +00:00
Eliseu Amaro adf484f58a
[COMPONENTS][Posting] No error to ignore was reported on line 161, removed ignore
[PLUGINS][Directory] Further documentation work

[CORE][Controller] Separating workflows, setting proper return types

[TWIG][Security] Removing unused stylesheet calls
2022-01-26 20:54:55 +00:00
Eliseu Amaro 6a5312aca9
[CORE][GNUsocial] social.local.yaml is now updated with the proper node name 2022-01-26 18:46:31 +00:00
Eliseu Amaro e4a3438d55
[CORE][I18n] Fixing 'file_get_contents(): Argument #1 () must be of type string, Symfony\Component\Finder\SplFileInfo given' error by using Symfony's Finder to iterate through existing files 2022-01-23 19:07:39 +00:00
Diogo Peralta Cordeiro 6b1c6f603e
[CORE][ActorLocalRoles] Improve Roles 2022-01-22 18:47:56 +00:00
Hugo Sales 1856af68b3
[PLUGIN][RepeatNote][COMPONENTS][Posting] Review and fix RepeatNote. Handle attachment lives in Posting 2022-01-21 21:03:08 +00:00
Eliseu Amaro d29e28b829
[CORE][Entity] Replaced get_called_class() calls with static::class since the former is deprecated 2022-01-13 16:24:12 +00:00
Diogo Peralta Cordeiro 480f570238
[CORE][SECURITY][HTML] Refactor Security::sanitize to HTML::sanitize
Update composer dependencies, move more general deps from ActivityPub to Core
2022-01-12 17:12:58 +00:00
Hugo Sales cdf1d67d0f
[CORE][Cache] Workaround to redis not allowing empty lists 2022-01-09 12:29:34 +00:00
Diogo Peralta Cordeiro 0d1ab2c9cf
[SECURITY][Register] New users should have their current browser language set as first language preference 2022-01-05 04:19:35 +00:00
Diogo Peralta Cordeiro 5a0bbfc795
[UTIL][Common][I18N] Use actor's preferred language for _m and utility to retrieve current language even when no actor is logged in 2022-01-05 01:29:26 +00:00
Hugo Sales de8eab2cf8
[CORE][FORM][FormTypeNonceExtension] Add a nonce to all forms with a CSRF token 2022-01-04 18:58:32 +00:00