Project

General

Profile

Actions

Bug #87410

closed

BackendUtility::thumbCode variable $tparams ignored/unused

Added by Jan Siemon over 5 years ago. Updated almost 5 years ago.

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

100%

Estimated time:
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.

Actions #1

Updated by Jan Siemon over 5 years ago

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

Updated by Jan Siemon over 5 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review over 5 years 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

Actions #4

Updated by Gerrit Code Review over 5 years 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

Actions #5

Updated by Georg Ringer over 5 years ago

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

Updated by Gerrit Code Review over 5 years 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

Actions #7

Updated by Georg Ringer over 5 years ago

  • Status changed from Under Review to Resolved
Actions #8

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF