Review main Abandoned

52697[BUGFIX] Do not render broken <img> tag if processed file is not an image

Andreas Kienast CR 0 V 0 Easy +47 −1 updated 07/11/17, 10:49

Commit message

If <f:image> is used with a file object that originates from a file that
can’t be converted to an image (e.g. a word document), an empty <img> tag
is rendered.

The file extension of the processed “image” is now checked against
`GFX/imagefile_ext` and in case the file extension does not match,
an empty string is returned instead.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 710

  1. Andreas Kienast uploaded patch set 1 05/04/17, 08:59

  2. TYPO3com voted on patch set 1 V -1 05/04/17, 09:05 Completed build in 05m 19s on Thu, 4 May, 11:05 AM Test Summary: 12 of 55785 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11187

  3. Andreas Kienast uploaded patch set 2 05/04/17, 10:03

  4. TYPO3com voted on patch set 2 V -1 05/04/17, 10:13 Completed build in 09m 32s on Thu, 4 May, 12:13 PM Test Summary: 55718 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11189

  5. TYPO3com voted on patch set 2 V +1 05/04/17, 10:14 Completed build in 20m 16s on Thu, 4 May, 12:14 PM Test Summary: 55788 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11189

  6. Frans Saris commented on patch set 2 05/04/17, 11:01

    Not sure if this makes sense. Are there more checks like this in the core?
  7. Elmar Hinz commented on patch set 2 05/11/17, 11:00

    A missing image tag could heavily damage the CSS layout. I think a placeholder could be returned. What kind of placeholder? Ideas: - Span with a special class. The size info is missing then. - Image tag with empty URL. The browser decides how to display this. - Image tag linking a transparent pixel or a configurable placeholder image.
  8. Georg Ringer commented on patch set 2 05/11/17, 12:19

    ImageViewHelper.php:145

    IMO strtolower should be used, otherwise a JPG won't be recognized?
  9. Claus Due commented on patch set 2 CR -1 05/22/17, 18:54

    ImageViewHelper.php:145 Reply

    Please throw a ViewHelper Exception here with a message about the unsupported format. Rendering should not be silently suppressed - if you wish to avoid rendering these files you should have a condition further up in the hierarchy to prevent calling this ViewHelper in the first place.
  10. Andreas Kienast abandoned the change 07/11/17, 10:49