[BUGFIX] TypoScript userFunc condition does not work with static methods 62/34062/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:26:44 +0000 (16:26 +0100)
commit5ff97213d7da16ec01bb288e502b35c6296717dc
treeb58a22d5b3f69ba2087628f7af0f6a22314ba851
parent2ed3fc7b340b3318d8768dcf62a40ec0b6469ff9
[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/34062
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
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