Project

General

Profile

Bug #20257 » 10816_callUserFunction_v2.diff

Administrator Admin, 2009-05-20 11:54

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
// Split parts
$parts = explode('->',$funcName);
if (count($parts)==2) { // Class
$cls = t3lib_div::makeInstanceClassName($parts[0]);
// Check whether class is available:
if (class_exists($cls)) {
$classObj = new $cls;
if (method_exists($classObj, $parts[1])) {
$classObj->cObj = &$this;
$content = call_user_func_array(array($classObj, $parts[1]), array($content, $conf));
} else {
$GLOBALS['TT']->setTSlogMessage('Method "'.$parts[1].'" did not exist in class "'.$cls.'"',3);
}
$userFunctionObject = t3lib_div::makeInstance($parts[0]);
if (is_object($userFunctionObject) && method_exists($userFunctionObject, $parts[1])) {
$userFunctionObject->cObj = &$this;
$content = call_user_func_array(array($userFunctionObject, $parts[1]), array($content, $conf));
} else {
$GLOBALS['TT']->setTSlogMessage('Class "'.$cls.'" did not exist',3);
$GLOBALS['TT']->setTSlogMessage('Method "'.$parts[1].'" did not exist in class "'.$cls.'"',3);
}
} else { // Function
if (function_exists($funcName)) {
(4-4/5)