Project

General

Profile

Actions

Bug #17944

closed

tslib_cObj uses deprecated function call_user_method

Added by Ivan over 16 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
-
Start date:
2007-12-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

tslib_cObj uses deprecated function call_user_method which should be updated to call_user_func_array. If Exceptions are envolved the disposal of deprecated function call_user_method causes a blank page.

Deprecated function call_user_method have problems with exceptions. It's used in:

typo3/sysext/cms/tslib/class.tslib_content.php:5697:
$content = call_user_method($parts1, $classObj, $content, $conf);

I make several test and using recommended function call_user_func thrown exceptions show correctly fatal error message by following test don't show it:

class test {

function foo()
  {
throw new Exception('bar');
}
}

try {
$a = new test();

call_user_method('foo',$a);

} catch (Exception $e) {
echo $e->getMessage();
}

//Expected result: bar

Result in web :

Warning: call_user_method() [function.call-user-method]: Unable to call
foo() in ....

Result in CLI :
Notice: call_user_method(): This function is deprecated, use the
call_user_func variety with the array(&$obj, "method") syntax instead in
/home/igalia/igomez/TMP/TESTING_EXCEPTIONS/prueba1.php on line 16

bar

In CLI seems work but not in web.

A similar test, throwing exceptions in a plugin code do blank page, and refreshing the page show following warnings and next uncaught exception message:

Warning: call_user_method() [function.call-user-method]: Unable to call main() in [....]/typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_content.php on line 5712

Warning: call_user_method() [function.call-user-method]: Unable to call main_page() in [....]/typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_content.php on line 5712

I think call_user_func (in typo3/sysext/cms/tslib/class.tslib_content.php:5706:) is called when page is refreshing and then ucaugth message is showed
(issue imported from #M7029)


Files

bug_0007029.patch (664 Bytes) bug_0007029.patch Administrator Admin, 2008-02-04 11:43
0007029.patch (674 Bytes) 0007029.patch Administrator Admin, 2008-02-04 12:59
Actions

Also available in: Atom PDF