60299[BUGFIX] Prevent division by zero when scaling image
Commit message
Review
-
Code review CR +2 Done
- Anja Leichsenring +2
- Daniel Goerz +1
- Oliver Klee +1
- Oliver Hader +1
-
Verified V +2 Done
- Anja Leichsenring +2
- Daniel Goerz +1
- TYPO3com +1 CI
Issues 1
Files 2
Review log 1719
-
Claus Due uploaded patch set 1 03/19/19, 14:35
-
TYPO3com voted on patch set 1 V +1 03/19/19, 14:50 Completed build in 14m 51s on Tue, 19 Mar, 03:50 PM Test Summary: 47201 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32858
-
Steffen Frese voted on patch set 1 CR +1 04/08/19, 09:17
-
Oliver Klee commented on patch set 1 04/08/19, 10:24
-
Claus Due commented on patch set 1 04/08/19, 10:32
GraphicalFunctions.php:2347ReplyAs far as I am aware, an image cannot have a width without a height, as these are values returned from getimagesize(). The case where one is filled but not the other cannot happen and does not need to be supported - the result is that a single check can be used instead of needing several identical checks below. -
Oliver Klee commented on patch set 1 CR +1 04/08/19, 10:49
Okay, makes sense. Thanks for the explanation! -
Julian Geils voted on patch set 1 V +1 CR +1 04/08/19, 14:28
-
Steffen Frese commented on patch set 1 V +1 04/12/19, 08:27
tested on master -
Susi Moog commented on patch set 1 04/14/19, 14:08
I don't consider this issue critical and would remove 8.7 from releases. -
Claus Due commented on patch set 1 04/14/19, 14:53
@Susi I would consider this critical as it causes PHP warning-level errors. -
Susi Moog commented on patch set 1 04/14/19, 15:41
> Patch Set 1: > > @Susi I would consider this critical as it causes PHP warning-level errors. Ok, maybe I should explain more on why/how I evaluate critical personally: 8.7 was released "a long time ago", sites running on it run with the quirks / issues it currently have. The issue does only appear in edge cases afaics (from the amount of reports and the code). The method is untested and potential side effects for all cases can therefor only be evaluated "manually" which in my eyes is pretty error prone. Weighing that (and the potential impact on the instances "out there" which I simply can't guarantee to work as before) against the benefit of getting rid of a PHP Warning is too risky imho and I would not do it. -
Claus Due commented on patch set 1 04/15/19, 12:01
> Patch Set 1: > > > Patch Set 1: > > > > @Susi I would consider this critical as it causes PHP warning-level errors. > > Ok, maybe I should explain more on why/how I evaluate critical personally: 8.7 was released "a long time ago", sites running on it run with the quirks / issues it currently have. The issue does only appear in edge cases afaics (from the amount of reports and the code). The method is untested and potential side effects for all cases can therefor only be evaluated "manually" which in my eyes is pretty error prone. Weighing that (and the potential impact on the instances "out there" which I simply can't guarantee to work as before) against the benefit of getting rid of a PHP Warning is too risky imho and I would not do it. I can acknowledge those reasons but as for impact, the difference is either getting a returned image size that contains zeroes *and* get a PHP warning, or get image sizes that return zeroes and no PHP warning. The current site I have which expresses this has at this time 20,000 log lines and growing with this PHP warning. It's a 8.7 site. Assuming it isn't possible to fix the deeper cause of images that return invalid sizes, what would be your suggestion to avoid these log lines? If we don't merge this to 8.7 LTS we shouldn't merge this to 9.5 LTS either but I still think this is basic and sane enough that there's no danger. The return value is still zero-by-zero dimensions if that code isn't engaged, which it shouldn't be if the input is zero. -
Daniel Goerz uploaded patch set 2 04/24/19, 17:35
-
Daniel Goerz voted on patch set 2 V +1 CR +1 04/24/19, 17:36
-
Oliver Klee voted on patch set 2 CR +1 04/24/19, 17:48
-
Oliver Hader voted on patch set 2 CR +1 04/24/19, 17:48
-
TYPO3com voted on patch set 2 V +1 04/24/19, 17:49 Completed build in 13m 35s on Wed, 24 Apr, 07:49 PM Test Summary: 47488 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33386
-
Anja Leichsenring voted on patch set 2 V +2 CR +2 06/05/19, 20:11
-
Anja Leichsenring merged patch set 3 06/05/19, 20:11
GraphicalFunctions.php:2347