Bug #37609
t3lib_div::callUserFunction causes PHP warnings
| Status: | Accepted | Start date: | 2012-05-30 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| TYPO3 Version: | 4.7 | Complexity: | ||
| PHP Version: | ||||
| Votes: | 0 |
Description
line 4595 of t3lib/class.t3lib_div.php from the current trunk causes php warnings due to lack of conditions:
4591 public static function callUserFunction($funcName, &$params, &$ref, $checkPrefix = 'user_', $errorMode = 0) {
4592 $content = FALSE;
4593
4594 // Check persistent object and if found, call directly and exit.
4595 if (is_array($GLOBALS['T3_VAR']['callUserFunction'][$funcName])) {
4596 return call_user_func_array(
4597 array(&$GLOBALS['T3_VAR']['callUserFunction'][$funcName]['obj'],
4598 $GLOBALS['T3_VAR']['callUserFunction'][$funcName]['method']),
4599 array(&$params, &$ref)
4600 );
4601 }
in case $funcName is an existing key of the array $GLOBALS['T3_VAR']['callUserFunction'] everything works fine.
in case it isn't, it produces warnings like this:
Core: Error handler (FE): PHP Warning: Illegal offset type in /opt/typo3/typo3_src-4.5/t3lib/class.t3lib_div.php line 4595
so i guess adding two extra conditions to the if statement like this
4595 if (array_key_exists('callUserFunction', $GLOBALS['T3_VAR']) && array_key_exists($funcName, $GLOBALS['T3_VAR']['callUserFunction']) && is_array($GLOBALS['T3_VAR']['callUserFunction'][$funcName])) {
fixes that, right?
History
Updated by Georg Ringer 12 months ago
wanna push a change to gerrit?
Updated by Jigal van Hemert 12 months ago
- Status changed from New to Accepted
Updated by Philipp Kitzberger 3 days ago
Seems to be only a PHP Notice with PHP 5.3, doesn't it? Fixing needed?