Commit Graph

145 Commits

Author SHA1 Message Date
Hugo Sales 8fe8687c5b
[UTIL][HTML] Move to a unified array 2021-09-20 13:28:18 +01:00
Hugo Sales e8f4563633
[UTIL][Formatting][COMPONENT][Link][Tag] Refactor code from formatting into Link and Tag, where appropriate. Drop 'perfect url regex' as the one used in v2 is better 2021-09-20 13:28:18 +01:00
Hugo Sales 04174bc56d
[UTIL][UI] Change how plaintext notes are rendered to be split into paragraphs. Remove span around tags 2021-09-20 13:27:27 +01:00
Hugo Sales 51c7e10483
[UTIL][HTML] Allow specifying `options: [raw => bool]`, whether to escape the provided inner HTML or not. Use with care 2021-09-20 13:27:21 +01:00
Diogo Peralta Cordeiro 67d62cf37b
[TWIG] Remove kludge event TwigPopulateVars 2021-09-18 07:27:35 +01:00
Diogo Peralta Cordeiro 941cbe6599
[Actor] Refactor GSActor into Actor 2021-09-18 05:12:17 +01:00
Hugo Sales b177cb69e7
[HTML][SECURITY] Harden implmentation of HTML generation 2021-09-18 05:12:08 +01:00
Hugo Sales 8f0a3e4977
[UI] Add mechanism for rendering note contents in different formats. Implement plaintext rendering. Use rendered field for note content, rather than the content itself 2021-09-18 05:12:06 +01:00
Hugo Sales 15a2a69274
[ROUTER] Add option `is_system_path`, to allow specifying that a route, such as `gsactor_view_nickname` should not be considered a system path, when checking for the collision of nicknames 2021-09-18 05:12:05 +01:00
Eliseu Amaro e9d809d441 [Security][Exception] Security exception handling, login and register. TODO EmailNotFoundException and NicknameNotFoundException. 2021-09-15 14:48:06 +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 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +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 cbbef90752
[UTIL][CONFIG] Ensure `setConfig` uses a `locals` key 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 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
Diogo Peralta Cordeiro 2b457655ea
[CORE] Fix path configuration 2021-09-14 13:13:35 +01:00
Eliseu Amaro 44a581f0f6
[UTIL][FORM] Password form now shows the proper HTML class, and it's respective label. 2021-09-14 13:13:30 +01:00
Hugo Sales c3db2f60d2
[UTIL][EXCEPTIONS] Introduce NotStoredLocallyException 2021-09-14 13:13:28 +01:00
Diogo Peralta Cordeiro 63cbf4052f
[UTIL] Common::config wasn't a proper port from v2, it has to accept one argument only as well 2021-09-14 13:13:25 +01:00
Hugo Sales 809bf00aa9
[TemporaryFile][TESTS] Throw on attempt to write to null resource and fix tests 2021-09-14 13:13:24 +01:00
Hugo Sales 2851b899b8
[TESTS] Add test annotations to core classes 2021-09-14 13:13:23 +01:00
Hugo Sales 1b623a85ae
[UTIL][FormFields] Move FormFields class to Util\Form namespace 2021-09-14 13:13:22 +01:00
Hugo Sales 9ad2cb5e66
[UTIL][FormFields] Allow specifying whether a password is required and provide placeholder text 2021-09-14 13:13:20 +01:00
Hugo Sales 19318b3163
[UTIL][EXCEPTION] Add AuthenticationException, representing an auth error, status code 401 unauthorized 2021-09-14 13:13:20 +01:00
Hugo Sales 855d427442
[UTIL][FORM] Create a utility class that defines common form fields, such as passwords 2021-09-14 13:13:18 +01:00
Hugo Sales 0c54a3297f
[UTIL] Add a class that defines commonly used form fields 2021-09-14 13:13:17 +01:00
Hugo Sales d07cb79844
[EXCEPTION] Add Email related exceptions 2021-09-14 13:13:16 +01:00
Hugo Sales e250edf7fd
[UTIL][Nickname] Refactor Nickname and extract a validate function, as we'll want to perform normalization in select cases in the future, likely as a plugin 2021-09-14 13:13:16 +01:00
Hugo Sales 7a2574eafb
[CORE][TemporaryFile] Add option to specify attempts and better handle when reaching the attemp limit without being able to create a file 2021-09-14 13:13:15 +01:00
Diogo Peralta Cordeiro c020958690
[DOCS] Write exceptions chapter 2021-09-14 13:13:09 +01:00
Hugo Sales cb7fa0a081
[SECURITY] Remove aggressive normalization of nicknames. This will be moved to a plugin in the future and we'll open an RFC, as discussed 2021-09-14 13:13:04 +01:00
Diogo Peralta Cordeiro 861732176e
[Media] Support any kind of thumbnails in the Core
Sanitize Attachments instead of Validate (part 1)
Ensure the intended filetypes and mimetypes during Vips conversions (part 1)
Various bug fixes
2021-09-14 13:13:03 +01:00
Diogo Peralta Cordeiro 72dcff22f7
[MEDIA] We need permissions to run chmod in directories
It's better to have in the filename data that we couldnt't otherwise rapidly retrieve
2021-09-14 13:13:03 +01:00
Diogo Peralta Cordeiro c8cf8c3f13
[FILE][TemporaryFile] Fix various issues now that we also have Symfony's file abstractions 2021-09-14 13:13:03 +01:00
Hugo Sales 687b2e2bc7
[UTIL] Add utility to flatten the result of note queries 2021-09-14 13:13:02 +01:00
Hugo Sales 86400ce815
[UTIL] Provide static access to current request and utilities in Common 2021-09-14 13:13:02 +01:00
Hugo Sales e1a1d01844
[TESTS] Add GNUsocialTestCase, which initializes our infrastructure when bootKernel is called 2021-09-14 13:13:01 +01:00
Hugo Sales fbe0f36a53
[TESTS] Expand test coverage for App\Util\Forms\ArrayTransformer, App\Util\Notification and App\Twig\Runtime 2021-09-14 13:13:00 +01:00
Hugo Sales fc9b934bbc
[UTIL] Fix App\Util\TemporaryFile, adding default options and preventing warning on not enough permission 2021-09-14 13:12:59 +01:00
Hugo Sales ec1081ed43
[UTIL] Rename and rewrite isTaken to checkTaken 2021-09-14 13:12:59 +01:00
Hugo Sales a49ee453ab
[TESTS] Raise App\Util\HTML test coverage to 100% 2021-09-14 13:12:58 +01:00
Hugo Sales fbea08ca9b
[TESTS] Raise App\Util\Bitmap test coverage to 100% 2021-09-14 13:12:58 +01:00
Hugo Sales abda73b8e3
[TESTS] Raise App\Util\Common test coverage to 100% 2021-09-14 13:12:58 +01:00
Hugo Sales 2b83a4b627
[UTILS][TemporaryFile] Change way TemporaryFile takes arguments and it's internal implementation 2021-09-14 13:12:58 +01:00
Hugo Sales 3b39046a38
[UTIL] Fix bugs found in App\Util\Formatting by tests 2021-09-14 13:12:58 +01:00