Issue Bug Closed

#22594Class prefix problem in getUserObj and callUserFunction (t3lib_div)

Jean-David Gadina 05/05/10, 17:43 updated 10/24/17, 20:18

Description

In the t3lib_div class, methods getUserObj and callUserFunction actually check that classes/functions have a valid prefix.

The prefix can be “tx_”, for TYPO3 extensions, or a prefix defined in the installTool, for user classes/functions (default value is “user_”).

Those two methods should IMHO also allow the “Tx_” prefix (with a T in uppercase), as it is the prefix used when developing extensions with “extbase”.

Actually, here’s the condition:

if ($checkPrefix &&
!self::isFirstPartOfStr(trim($funcRef),$checkPrefix) &&
!self::isFirstPartOfStr(trim($funcRef),‘tx_’)
)

Should be something like:

if ($checkPrefix &&
!self::isFirstPartOfStr(trim($funcRef),$checkPrefix) &&
!(self::isFirstPartOfStr(trim($funcRef),‘tx_’) || self::isFirstPartOfStr(trim($funcRef),‘Tx_’))
)

Both method should be changed. Please see the attached patch.

(issue imported from #M14313)

Reviews 2