Project

General

Profile

Actions

Bug #37609

closed

t3lib_div::callUserFunction causes PHP warnings

Added by Anonymous over 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2012-05-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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?

Actions #1

Updated by Georg Ringer over 12 years ago

wanna push a change to gerrit?

Actions #2

Updated by Jigal van Hemert over 12 years ago

  • Status changed from New to Accepted
Actions #3

Updated by Anonymous over 11 years ago

Seems to be only a PHP Notice with PHP 5.3, doesn't it? Fixing needed?

Actions #4

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.1 (Cleanup)
  • Is Regression set to No
Actions #5

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #6

Updated by Georg Ringer over 9 years ago

  • Category set to 1499
  • Sprint Focus set to On Location Sprint
Actions #7

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41603

Actions #8

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41603

Actions #9

Updated by Harry Glatz over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Anja Leichsenring almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #11

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF