Bug #87410

BackendUtility::thumbCode variable $tparams ignored/unused

Added by Jan Siemon 6 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2019-01-11
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

When calling

\TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode
its 8th parameter, variable $tparams ("Optional: $tparams is additional attributes for the image tags"), does not do anything or to much depending on case: calling it with FAL reference or parameter $uploaddir.

  1. When calling with FAL reference the parameter does not do anything, since the variable is not used in the code (BackendUtility.php:1348-1411)
    Line 1398
     $imgTag = '<img ' . GeneralUtility::implodeAttributes($attributes, true) . '/>';
    should make use of that variable.
  2. When using the $uploaddir parameter (BackendUtility.php:1413-1476) it is used in generating the image tag, cf. line 1458:
    $image = '<img src="' . htmlspecialchars($imageUrl) . '" hspace="2" border="0" title="' . htmlspecialchars($fileObject->getName()) . '"' . $tparams . ' alt="" />';

    Yet, the possible additional attributes "hspace" and "border", for example, are already present in that line.

=> The variable should also be used in the first case.
=> Any string which is passed through the variable should be chcecked if it is a viable attribute of an img-tag before being added to the final result.

Associated revisions

Revision 8a6509f2 (diff)
Added by Georg Ringer 5 months ago

[BUGFIX] Use argument $tparams BackendUtility::thumbCode for FAL items

Add the argument $tparams to the image tag also for FAL items.

Resolves: #87410
Releases: master, 9.5
Change-Id: I4961a829e2497c747824a76ce5277a7dfe35c2d1
Reviewed-on: https://review.typo3.org/59417
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Fabien Udriot <>
Tested-by: Fabien Udriot <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

Revision 4a77abe6 (diff)
Added by Georg Ringer 5 months ago

[BUGFIX] Use argument $tparams BackendUtility::thumbCode for FAL items

Add the argument $tparams to the image tag also for FAL items.

Resolves: #87410
Releases: master, 9.5
Change-Id: I4961a829e2497c747824a76ce5277a7dfe35c2d1
Reviewed-on: https://review.typo3.org/59431
Tested-by: TYPO3com <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

History

#1 Updated by Jan Siemon 6 months ago

  • Description updated (diff)
  • Complexity changed from easy to medium

#2 Updated by Jan Siemon 6 months ago

  • Description updated (diff)

#3 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59417

#4 Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59431

#5 Updated by Georg Ringer 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Teams/Security/TYPO3v4-Core has been pushed to the review server.
It is available at https://review.typo3.org/59434

#7 Updated by Georg Ringer 5 months ago

  • Status changed from Under Review to Resolved

#8 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF