[TYPO3-core] RFC #14880: bugfix : t3lib_iconWorks::getSpriteIconForRecord() accepts non-array as record

Jigal van Hemert jigal at xs4all.nl
Sat Jun 26 16:04:05 CEST 2010


Hi,

This is a SVN patch request.

Type: Bugfix / cleanup

BT reference: http://bugs.typo3.org/view.php?id=14880

Branches: trunk / 4.4 (if RM agrees)

Problem:
t3lib_iconWorks::getSpriteIconForRecord() has as second parameter the 
data row for which the icon must be found.
If an integer is passed as argument this is not detected and various 
actions inside the function result in a wrong icon/overlay being returned.

Solution:
Force argument to be an array

How to test:
See discussion in core list on #14824, where it turned out that 
t3lib_tsparser_ext::ext_getTemplateHierarchyArr() called 
getSpriteIconForRecord() with $row['root'] instead of $row. The effect 
was that the test for the 'hidden' property produced TRUE and an 
incorrect overlay was displayed.
Forcing the parameter to be an array will prevent such things from 
happening.

Notes:
When a non-array is passed as second argument PHP will end with a fatal 
error. This will at least force the programmer to correct his/her code.

-- 
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 14880.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100626/5953742b/attachment.asc>


More information about the TYPO3-team-core mailing list