[TYPO3-core] RFC #14313: Class prefix problem in getUserObj and callUserFunction (t3lib_div)
Peter Niederlag
typo3-list at niekom.de
Thu Jan 20 21:53:41 CET 2011
Hi Andreas,
very cool! :->
+1 by reading
two suggestions:
Add 'User_' | 'user_' by default inside hasValidClassPrefix()
Move the whole handling of $TYPO3_CONF_VARS['FE']['userFuncClassPrefix']
inside hasValidClassPrefix()
This would make it more general and useful and the former different
handling is not on purpose but by accident IMO.
This way we have one general way which works the same all over the
which allows 'Tx_|ts|User_|user_' by default and gives the choice to add
'Ak_' if you feel like it.
That would IMO be the best solution.
Many thx for taking care! :->
Greets,
Peter
Am 20.01.2011 15:07, schrieb Andreas Kiessling:
> 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
>
>
>
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
--
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
More information about the TYPO3-team-core
mailing list