Skip to content

Replace MAX_IMAGE_BYTES constant in ImageManager.php with admin configurable environmental variable#987

Merged
2 commits merged intomainfrom
move_max_image_bytes_to_env_var
Aug 4, 2024
Merged

Replace MAX_IMAGE_BYTES constant in ImageManager.php with admin configurable environmental variable#987
2 commits merged intomainfrom
move_max_image_bytes_to_env_var

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 4, 2024

Closes #797

Retains "sane" default of 6000000 if admins forget to set the variable in the .env file.

@ghost ghost added enhancement New feature or request backend Backend related issues and pull requests labels Aug 4, 2024
@ghost ghost self-assigned this Aug 4, 2024
@ghost ghost requested review from BentiGorlich and jwr1 August 4, 2024 00:36
@ghost ghost changed the title Move MAX_IMAGE_BYTES constant in ImageManager.php to admin configurable environmental variable Replace MAX_IMAGE_BYTES constant in ImageManager.php to admin configurable environmental variable Aug 4, 2024
@ghost ghost changed the title Replace MAX_IMAGE_BYTES constant in ImageManager.php to admin configurable environmental variable Replace MAX_IMAGE_BYTES constant in ImageManager.php with admin configurable environmental variable Aug 4, 2024
Copy link
Copy Markdown
Member

@BentiGorlich BentiGorlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a fallback a lá ?? $defaultMaxBytes? Or is symfony always at least returning the max_image_bytes_default value?

Copy link
Copy Markdown
Member

@melroy89 melroy89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_image_bytes is set to max_image_bytes_default (default), so I expect no issues there.

@ghost ghost enabled auto-merge (squash) August 4, 2024 12:10
@ghost ghost merged commit 88440e0 into main Aug 4, 2024
@ghost ghost deleted the move_max_image_bytes_to_env_var branch August 4, 2024 12:12
@melroy89
Copy link
Copy Markdown
Member

This variable was wrongly introduced, and should have been called: MBIN_MAX_IMAGE_BYTES instead..

Fixed: #1878

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related issues and pull requests enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow adjustment of MAX_IMAGE_BYTES

2 participants