[TYPO3-core] RFC #14313: Class prefix problem in getUserObj and callUserFunction (t3lib_div)
Andreas Kiessling
kiessling at pluspol.info
Thu Jan 20 15:07:50 CET 2011
Hi,
hm, method is now bit longer than 3 lines ;) and called hasValidClassPrefix
Some checks are also done against 'user_' or the
TYPO3_CONF_VARS['FE']['userFuncClassPrefix'], so i added a parameter for
an additional allowed prefix.
Still hardcoded though, but didn't touch it since it is in JS:
- jsfunc.evalfield.js -> if (theEvalType.slice(0, 3) == 'tx_') {
Attached is also a small extension to test the newly allowed Tx_ prefix
for cObject USER
Just include it like this:
###snip###
includeLibs.Tx_testclass = EXT:test_tx/Tx_testclass.php
includeLibs.Wrong_prefix = EXT:test_tx/Wrong_prefix.php
config.admPanel = 1
page.39 = TEXT
page.39.value (
)
page.40 = USER
page.40.userFunc = Tx_testclass->main
page.41 = TEXT
page.41.value (
)
page.45 = USER
page.45.userFunc = Wrong_prefix->main
###snip###
Only the second userFunc should give you warning in the admin panel
after applying the patch.
Function "Wrong_prefix->main" was not prepended with "user_"
Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14313_v2.patch
Type: text/x-patch
Size: 8469 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20110120/ab7f89f5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_tx.t3x
Type: application/octet-stream
Size: 4167 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20110120/ab7f89f5/attachment.obj>
More information about the TYPO3-team-core
mailing list