-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Prevent loading images that would require too much memory. #30291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9d98b3b to
87c4ba5
Compare
87c4ba5 to
e542852
Compare
|
Hey @fancycode , could you address the comments ? :) |
Happy new year to you, too. I just came back from vacation today and are going through my inbox. Will address the comments as soon as possible. |
|
All comments addressed. Commits should be squashed and the text of the first commit should be adjusted (limit is now read from config.php instead of the app config) - I can do this before merging. |
For most image formats, the header specifies the width/height. PHP allocates an image object from that size, even if the actual image data is much smaller. This image object size is not limited by the limit configured in PHP. The memory limit can be configured through "config.php" setting "preview_max_memory" and defaults to 128 MBytes which should be enough for most images without filling up all memory. Signed-off-by: Joachim Bauch <[email protected]>
5b4e1a8 to
d3d65e5
Compare
|
Commits are squashed and the message is updated, so this is ready to merge from my side. |
|
Thanks for merging. Probably would be good to also backport this change to all versions that still receive security updates. |
|
/backport to stable23 |
|
/backport to stable22 |
|
/backport to stable21 |
For most image formats, the header specifies the width/height. PHP allocates an image object from that size, even if the actual
image data is much smaller. This image object size is not limited by the limit configured in PHP.
The memory limit can be configured through config setting "preview_max_memory" and defaults to 128 MBytes which should be enough for most images without filling up all memory.
Signed-off-by: Joachim Bauch [email protected]