[BUGFIX] TypoScript userFunc condition does not work with static methods 87/34087/2
authorOliver Hader <oliver@typo3.org>
Thu, 13 Nov 2014 12:55:40 +0000 (13:55 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Thu, 13 Nov 2014 15:27:04 +0000 (16:27 +0100)
commit10d27be660507b28bb150ba7bee8ea72c5706a56
treeb23ac1953b8d88762ce30d837f47f3e1749af8ce
parent0f1a9aa3c9dd7d710ecd8bf9a57d51a304bc2337
[BUGFIX] TypoScript userFunc condition does not work with static methods

TypoScript allows to utilize functions (user-functions) to
integrate custom condition processing. However, this currently
only works with function defined in the global namespace - it
does not work with static methods.

Thus, something like this snipped won't work:
[userFunc = ConditionMatcherUserFunctions::isTrue(1)]

The solution is simple, replace function_exists() with a more
generic is_callable() check.

Fixes: #62918
Releases: master, 6.2
Change-Id: I260c73cac26dfd14efc67bc9f65ff39d6ba74da8
Reviewed-on: http://review.typo3.org/34087
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Tests/Unit/Configuration/ConditionMatcherTest.php
typo3/sysext/core/Tests/Unit/Configuration/ConditionMatcherUserFuncs.php