Commit Graph

7 Commits

Author SHA1 Message Date
Miguel Dantas
b224d93098 [MEDIA] ImageFile now extends MediaFile and validates images more aggressively.
Default supported files need to use consistent names. Bumped version to 1.20.0

ImageFile has been changed to extend MediaFile and rely on it to partially
validate files. This validation has been extended to not rely solely on
Fileinfo, as it is disabled on some places. Now it'll try to use the shell
command `file`, if Fileinfo isn't available.

ImageFile now converts every new upload to PNG, except JPEG and GIF, which
are kept, but still resized (to the same size), to remove possible scripts
embedded therein.

MediaFile::fromUpload will return an ImageFile if the uploaded file is an image
or a MediaFile otherwise.

MediaFile can be constructed with an id with value -1 to denote a temporary
object, which is not added to the DB. This is useful to create a temporary
object for representing images, so it can be used to rescale them.

The supported attachment array needs to be populated with the result of calling
`image_type_to_extension` for the appropriate image type, in the case of images.
This is important so all parts of the code see the same extension for each image
type (jpg vs jpeg).

Added documentation to classes/File.php and to lib/MediaFile and lib/ImageFile
2019-06-10 00:35:53 +01:00
Diogo Cordeiro
9f51692f26 [NGINX conf] Move /var/run to /run
As seen in https://lists.fedoraproject.org/pipermail/devel/2011-March/150031.html
Thanks to XRevan86 for reporting this :)
2019-06-07 15:02:10 +01:00
Diogo Cordeiro
72ee098e0b [DOCUMENTATION] EVENTS.txt: Add Nodeinfo plugin event 2019-06-07 15:02:07 +01:00
Diogo Cordeiro
ab24f59660 [DOCUMENTATION] Add CONTRIBUTING information for developers
Inspired both from GNU FM, postActiv and Moodle
2019-06-07 15:02:00 +01:00
Diogo Cordeiro
3886db64bc [DOCUMENTATION] Update README.md 2019-06-05 22:48:29 +01:00
Diogo Cordeiro
eaea9d48c5 [DOCUMENTATION] Convert Configure to markdown, format and improve it by maiyannah and Normandy 2019-06-05 22:48:28 +01:00
Diogo Cordeiro
2e9fa8f4b7 [DOCUMENTATION] Reorganize documentation 2019-06-05 22:48:28 +01:00