1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-08 18:38:35 +02:00
phorge-phorge/src/applications/files
Andre Klapper 7a86040f8a Avoid exception setting project profile image when GD not installed
Summary:
When trying to set a custom project profile image while the PHP GD extension is not installed, use the same logic which already exists in `PhabricatorFilesComposeAvatarBuiltinFile.php` to set the default project image. This stills display an unhelpful error message `This server only supports these image formats: .` but avoids an exception trying to call GD's `imagecreatefromstring()`.

```
EXCEPTION: (Error) Call to undefined function imagecreatefromstring() at [<phorge>/src/applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php:131]
```

Closes T15326

Test Plan:
1. Remove the php-gd (and potentially gd) packages on your system; restart httpd
2. Go to http://phorge.localhost/project/manage/1/
3. Select `Edit Picture` in the sidebar on the right to go to the `Edit Project Picture` at http://phorge.localhost/project/picture/1/
4. Set a custom icon and color and click the `Save Image` button
5. Get `This server only supports these image formats: .` but no exception anymore

Reviewers: O1 Blessed Committers, avivey, valerio.bozzolan

Reviewed By: O1 Blessed Committers, avivey, valerio.bozzolan

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15326

Differential Revision: https://we.phorge.it/D25515
2024-01-23 15:10:56 +01:00
..
action Simplify implementation of "SysetemAction->getSystemActionConstant()" 2019-07-19 15:45:37 -07:00
application Show more in Application Detail and List view 2023-11-21 11:22:23 -07:00
applicationpanel Allow diffusion.filecontentquery to load data for arbitrarily large files 2016-01-21 09:52:43 -08:00
builtin Avoid exception setting project profile image when GD not installed 2024-01-23 15:10:56 +01:00
capability Add default policy to Files application 2014-11-21 11:17:20 -08:00
conduit Fix PHP 8.1 "base64_decode(null)" exception calling Conduit's file.upload with no data passed 2023-06-11 16:34:16 +02:00
config Enforce viewable MIME types config on PDF documents 2023-11-13 00:12:50 +08:00
constants Prettier file embeds 2016-11-27 14:57:06 -08:00
controller Fix PHP 8.1 "strlen(null)" exception opening a File overlay (Lightbox comment frame) 2023-07-05 19:38:44 +02:00
diff Fix two rendering issues with Jupyter notebooks 2020-05-22 11:53:55 -07:00
document Catch RuntimeException: mb_convert_encoding(): Illegal character encoding specified at PhabricatorTextDocumentEngine.php:73 2023-12-17 11:42:21 +01:00
editor Provide default image alt text in more contexts and support custom alt text 2021-03-04 16:51:23 -08:00
engine PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
engineextension Provide a simple "Attach File" explicit workflow for files referenced but not attached 2022-05-24 09:49:59 -07:00
exception Store and verify content integrity checksums for files 2017-04-05 11:12:31 -07:00
favicon Recover more gracefully when favicon configuration points at a corrupt/damaged file 2018-04-27 12:02:32 -07:00
format Fix some test suite stragglers with PHP 8.1 compatibility 2022-05-19 12:04:09 -07:00
garbagecollector Implement ngram search for File objects 2017-04-17 17:37:20 -07:00
iconset Convert all calls to 'IconFont' to just 'Icon' 2016-01-27 20:59:27 -08:00
keyring Support AES256 at-rest encryption in Files 2016-06-16 08:08:56 -07:00
lipsum Make bin/lipsum generate hanldle generator keys and arguments more clearly 2017-02-27 09:09:28 -08:00
mail Remove "metamta.*.subject-prefix" options 2019-01-17 19:18:50 -08:00
management Make "bin/files" parsing of working set arguments more consistent 2019-06-24 16:02:39 -07:00
markup Fix PHP 8.1 exceptions which block adding an embedded File preview as a Comment 2023-05-23 11:55:03 +02:00
phid Provide a simple "Attach File" explicit workflow for files referenced but not attached 2022-05-24 09:49:59 -07:00
query Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
storage preg_match() null exception setting custom user profile image with empty files.viewable-mime-types 2024-01-17 16:13:37 +01:00
transform Fix view policy inheritance on image transforms 2023-11-12 07:09:10 +08:00
typeahead Add a basic icon typeahead 2017-02-03 09:19:29 -08:00
uploadsource Support export of data in files larger than 8MB 2018-01-29 15:58:34 -08:00
view Fix numerous PHP 8.1 "strlen(null)" exceptions preventing homepage to display 2023-04-27 14:08:48 +02:00
worker Make daemons perform file deletion 2017-04-18 11:09:41 -07:00
xaction Fix PHP 8.1 "strlen(null)" exception removing custom alt text from image file 2023-11-28 14:52:00 +01:00
PhabricatorImageTransformer.php Somewhat improve meme transform code so it is merely very bad 2018-03-08 11:08:55 -08:00