Commit Graph

205 Commits

Author SHA1 Message Date
Hugo Sales 027c9a9324
[MODULES][PLUGINS] Move noteActionHandle utility to NoteHandlerPlugin which plugins which handle actions on notes should extend 2021-08-18 19:14:24 +01:00
Hugo Sales c03c6f1bb5
[UTIL][Form] Disallow using very generic form names, as they can collide with other forms in the same page 2021-08-18 18:35:03 +01:00
Hugo Sales e9fa41c5a8
[FORM] Fix bug where options were passed in the data parameter 2021-08-17 20:52:21 +01:00
Hugo Sales 69ff8c2750
[CORE][GSFile] Use pathinfo rather than regular expressions and don't attempt to persist an already persisted entity 2021-08-16 17:10:33 +01:00
Hugo Sales 5bd5c25dcf
[TESTS] Add coverage ignore flags to trivial methods 2021-08-16 17:08:29 +01:00
Hugo Sales e30ae79eb7
[DB][DOCUMENTATION] Explain limit: 2 in findOneBy 2021-08-16 17:07:00 +01:00
Hugo Sales fb861ed41f
[UTIL][EXCEPTIONS] Introduce NotStoredLocallyException 2021-08-16 17:06:02 +01:00
Hugo Sales 33bf99cfda
[ENTITY][Attachment] Raise mimetype max length to 64 characters and ensure we don't attempt to store more than that 2021-08-14 21:47:49 +01:00
Hugo Sales f3972abb70
[DOCUMENTATION][Entity] Improve documentation on Entity::getWithPK, explaining the ways it can be used 2021-08-14 19:49:50 +00:00
Diogo Peralta Cordeiro df5e7b139a
[CORE][GSFile] ensureFilenameWithProperExtension: extension isn't an I/O param 2021-08-14 17:04:57 +01:00
Diogo Peralta Cordeiro daaf7ea236
[Attachment] Sometimes we can't provide download of original file 2021-08-14 17:00:53 +01:00
Diogo Peralta Cordeiro 3019048585
[Posting] Re-add original file to attachment on upload, if it was previously removed 2021-08-14 17:00:52 +01:00
Diogo Peralta Cordeiro 6453593b0d
[MODULES] Add module configuration 2021-08-14 17:00:50 +01:00
Diogo Peralta Cordeiro f72cfd1c2b
[CORE][Event] Fix bug on handler Log 2021-08-14 17:00:50 +01:00
Diogo Peralta Cordeiro c0a404c640
[CORE][Entity] Compare with object properties when creating/updating, instead of class 2021-08-14 17:00:50 +01:00
Diogo Peralta Cordeiro ae7516c893
[ATTACHMENTS] Always store in the same location 2021-08-14 17:00:48 +01:00
Diogo Peralta Cordeiro 32ad5dbd74
[ENTITY] Split Attachment in various new entities
Remove Attachment Scope
Fixed some minor bugs

Scope will be implemented later in v3. It doesn't make sense to have
the scope handling being per attachment. Different actors can post
the same attachment with different scopes. The attachment controller
will assume the highest level of scope applied to the attachment and
the rest will be handled at the note level.

Motivation:
* Remove title from attachment, as it's part of the relation between attachment and note.
* Remove actor from attachment, many actors may publish the same attachment.
* Remove is_local from attachment,  as it's part of the relation between attachment and note.
* Remove remote_url from attachment, different urls can return the same attachment.

Addition:
* Attachment now has a lives attribute,  it's a reference counter with a nicer name
* GSActorToAttachment
* GSActorToRemoteURL
* RemoteURL
* RemoteURLToNote
* RemoteURLToAttachment
* AttachmentToNote now has a title attribute
2021-08-14 17:00:46 +01:00
Hugo Sales 66b39d3607
[ENTITY] Add JsonSerializable interface to Entity base class and implement it for the Note class 2021-08-14 16:13:00 +01:00
Hugo Sales 8e627f2c18
[TESTS] Add test annotations to core classes 2021-08-14 16:12:59 +01:00
Hugo Sales 7cace2051f
[CORE][Controller] Fix JSON response and add test annotations 2021-08-14 16:12:59 +01:00
Hugo Sales 47daf6169a
[CORE][Log] Add Log::unexpected_exception utility which logs and throws a ServerException 2021-08-14 16:12:56 +01:00
Hugo Sales 71b1ee7796
[CORE][Entity] Fix implementation of createOrUpdate so it doesn't throw NotFoundException if trying to create an object
This was previously done because we wanted to notify the callee that
and entity existed but not with the provided contents. With the change
of return value, with a bool $is_update, this is no longer a problem.
2021-08-14 16:12:55 +01:00
Eliseu Amaro 7308e66981
[Favourite][TWIG][CSS] Favourite now works. 2021-08-14 16:12:54 +01:00
Diogo Peralta Cordeiro 1556b3e019
[CORE][GSFile] Allow storing files under /file 2021-08-05 03:22:57 +01:00
Hugo Sales 0845224188
[CORE][DB] Specify desired case in array_change_case, for clarity 2021-08-04 20:11:47 +00:00
Hugo Sales 6b098a26f7
[CORE][GSFile] Ensure files are stored inside the configured storage folder, with a relative filename in the database 2021-08-03 19:37:56 +00:00
Hugo Sales 19a966f1a9
[CORE][CONTROLLER] Add TODO to Controller base class as to where our custom exception pages would be implemented 2021-08-03 19:23:03 +00:00
Hugo Sales f5f11b6e54
[CORE][ENTITY] Allow create'ing will null values 2021-08-03 19:23:03 +00:00
Hugo Sales d1e92a80e5
[CORE][GSFile] Assert that the destination folder where to store the attachment is inside the INSTALLDIR and store the filepath in the database 2021-08-03 19:23:02 +00:00
Hugo Sales 4297eb71a0
[CORE][GSFile] Change actor_id paramenter of validateAndStoreFileAsAttachment to optional and reorder them and their usages 2021-08-03 19:23:02 +00:00
Hugo Sales 56481c8289
[CORE] Add passowrd reset and forgot password functionality 2021-08-03 19:22:54 +00:00
Hugo Sales bdbd588de9
[CORE][SECURITY][EMAIL] Move email confirmation functionality to it's own static wrapper, in preparation for adding password reset functionality 2021-08-03 19:22:54 +00:00
Hugo Sales bff65afe5d
[TESTS][Queue] Add @codeCoverageIgnore to select queueing functions 2021-08-03 19:22:50 +00:00
Hugo Sales 6479b698f8
[TESTS][Router] Add tests for Router and use named paramenters, as we can since PHP8 2021-08-03 19:22:16 +00:00
Hugo Sales 2e3ec15827
[CORE][Controller][TESTS] Fix issue that arrises in tests where the Accept header is not specified 2021-08-03 19:22:12 +00:00
Hugo Sales c0e4dec674
[TESTS][DOCUMENTATION][Module] Add documentation and exclude method from testing in Module base class 2021-08-03 19:15:30 +00:00
Hugo Sales 88ab76c480
[CORE][TemporaryFile] Add option to specify attempts and better handle when reaching the attemp limit without being able to create a file 2021-08-03 19:14:56 +00:00
Hugo Sales 1f9acaf4ef
[TESTS] Add tests for GSFile 2021-08-03 19:13:30 +00:00
Hugo Sales 55710aa33d
[DB] Refactor findOneBy method 2021-08-03 19:13:29 +00:00
Hugo Sales 400716c1b2
[TESTS] Exclude class Security from testing, as it's a simple wrapper 2021-08-03 19:13:29 +00:00
Hugo Sales 75c9ffde31
[TESTS] Raise test coverage for ModuleManager to 100% 2021-08-03 19:13:29 +00:00
Hugo Sales 4258148a03
[TESTS] Exclude HTTPClient from testing, as it's a simple wrapper and we don't want to be performing HTTP requests in tests, for speed and reliability 2021-08-03 19:13:29 +00:00
Hugo Sales 6956e6907c
[TESTS] Raise test coverage for Form to 100% 2021-08-03 19:13:29 +00:00
Hugo Sales 5777cdeaf9
[TESTS][LOG] Raise test coverage for Log class to 100% 2021-08-03 19:13:28 +00:00
Hugo Sales b0ef7599b2
[TESTS] Ignore GNUsocial class from tests, as it simply pipes objects around 2021-08-03 19:13:28 +00:00
Hugo Sales 2c74bd7fb4
[FORM][DOCUMENTATION] Add documentation to Form class 2021-08-03 19:13:28 +00:00
Hugo Sales b9fdaa1401
[EVENT] Fixup implementation, as imformed by tests 2021-08-03 19:13:28 +00:00
Hugo Sales 88bb0c6b38
[ENTITY] Fixup implementation, as imformed by tests 2021-08-03 19:13:28 +00:00
Hugo Sales df956a5f90
[DB] Handle using methods with class name as well as table name and add lookup methods 2021-08-03 19:13:28 +00:00
Hugo Sales b79629b6d2
[TESTS][CACHE] Fixup errors found in cache implementation by testing. Ensure the newest values are kept, in pushList with max_count 2021-08-03 19:13:27 +00:00