Uh oh!
There was an error while loading. Please reload this page.
Prevent loading images that would require too much memory. - #30291
Conversation
9d98b3b to
87c4ba5Compare87c4ba5 to
e542852CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
skjnldsv
commented
Jan 10, 2022
Hey @fancycode , could you address the comments ? :) |
fancycode
commented
Jan 10, 2022
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. |
fancycode
commented
Jan 10, 2022
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 <bauch@struktur.de>
5b4e1a8 to
d3d65e5Comparefancycode
commented
Jan 11, 2022
Commits are squashed and the message is updated, so this is ready to merge from my side. |
fancycode
commented
Jan 11, 2022
Thanks for merging. Probably would be good to also backport this change to all versions that still receive security updates. |
nickvergessen
commented
Jan 11, 2022
/backport to stable23 |
nickvergessen
commented
Jan 11, 2022
/backport to stable22 |
nickvergessen
commented
Jan 11, 2022
/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 bauch@struktur.de