Project

General

Profile

Feature #20450 ยป patch_matchuserfunc.diff

Administrator Admin, 2009-05-18 17:07

View differences:

t3lib/class.t3lib_matchcondition.php (working copy)
return t3lib_div::compat_version($value);
break;
case 'userFunc':
$values = preg_split('/[\(\)]/', $value);
$funcName = trim($values[0]);
$funcValue = t3lib_div::trimExplode(',', $values[1]);
$pre = $GLOBALS['TSFE']->TYPO3_CONF_VARS['FE']['userFuncClassPrefix'];
if ($pre &&
!t3lib_div::isFirstPartOfStr(trim($funcName),$pre) &&
!t3lib_div::isFirstPartOfStr(trim($funcName),'tx_')
) {
if (is_object($GLOBALS['TT'])) $GLOBALS['TT']->setTSlogMessage('Match condition: Function "'.$funcName.'" was not prepended with "'.$pre.'"',3);
return false;
}
if (function_exists($funcName) && call_user_func($funcName, $funcValue[0])) {
$values = preg_split('/[\(\)]/', $value);
$funcName=trim($values[0]);
$funcValues = t3lib_div::trimExplode(',', $values[1]);
// backwards compatible
if (count($funcValues) == 1) {
list($funcValues) = $funcValues;
}
if (t3lib_div::callUserFunction($funcName, $funcValues, $this, $GLOBALS['TSFE']->TYPO3_CONF_VARS['FE']['userFuncClassPrefix'])) {
return true;
}
}
break;
}
    (1-1/1)