cvs: Zend / zend_builtin_functions.c php4 NEWS
| From: | Andrei Zmievski | Date: | Wed, 12 Jun 2002 17:02:22 +0000 |
| Subject: | cvs: Zend / zend_builtin_functions.c php4 NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-165@lists.php.net to get a copy of this message | ||
andrei Wed Jun 12 13:02:22 2002 EDT
Modified files:
/php4 NEWS
/Zend zend_builtin_functions.c
Log:
set_error_handler() should take methods as callbacks. Also fixed it to report
invalid callbacks.
Index: php4/NEWS
diff -u php4/NEWS:1.1010 php4/NEWS:1.1011
--- php4/NEWS:1.1010 Wed Jun 12 12:46:20 2002
+++ php4/NEWS Wed Jun 12 13:02:19 2002
@@ -1,6 +1,8 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2002, Version 4.3.0
+- Fixed set_error_hanlder() to accept methods as callbacks and also
+ report invalid callbacks. (Andrei)
- Fixed a memory corruption bug in overload extension. (Andrei)
- Impelemented timeout functionality, and fixed error handling of fsockopen()
on win32.
Index: Zend/zend_builtin_functions.c
diff -u Zend/zend_builtin_functions.c:1.117 Zend/zend_builtin_functions.c:1.118
--- Zend/zend_builtin_functions.c:1.117 Sat Jun 8 09:45:23 2002
+++ Zend/zend_builtin_functions.c Wed Jun 12 13:02:22 2002
@@ -851,13 +851,21 @@
ZEND_FUNCTION(set_error_handler)
{
zval **error_handler;
+ char *error_handler_name;
zend_bool had_orig_error_handler=0;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
- convert_to_string_ex(error_handler);
+ if (!zend_is_callable(*error_handler, 0, &error_handler_name)) {
+ zend_error(E_WARNING, "%s() expects argument 1, '%s', to be a valid
callback",
+ get_active_function_name(TSRMLS_C), error_handler_name);
+ efree(error_handler_name);
+ return;
+ }
+ efree(error_handler_name);
+
if (EG(user_error_handler)) {
had_orig_error_handler = 1;
*return_value = *EG(user_error_handler);