iliaa Mon Sep 18 23:08:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main main.c Log: Avoid generating php_errormsg twice in some instances. http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.14&r2=1.640.2.23.2.15&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.14 php-src/main/main.c:1.640.2.23.2.15 --- php-src/main/main.c:1.640.2.23.2.14 Mon Sep 18 03:29:21 2006 +++ php-src/main/main.c Mon Sep 18 23:08:36 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.640.2.23.2.14 2006/09/18 03:29:21 iliaa Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.15 2006/09/18 23:08:36 iliaa Exp $ */ /* {{{ includes */ @@ -572,7 +572,8 @@ efree(docref_buf); } - if (PG(track_errors) && module_initialized && EG(active_symbol_table)) { + if (PG(track_errors) && module_initialized && EG(active_symbol_table) && + (!EG(user_error_handler) || !(EG(user_error_handler_error_reporting) & type))) { zval *tmp; ALLOC_INIT_ZVAL(tmp); ZVAL_STRINGL(tmp, buffer, buffer_len, 1); @@ -846,16 +847,14 @@ efree(buffer); return; } + if (PG(track_errors) && module_initialized && EG(active_symbol_table)) { zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL(tmp); - Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len); - Z_STRLEN_P(tmp) = buffer_len; - Z_TYPE_P(tmp) = IS_STRING; + ALLOC_INIT_ZVAL(tmp); + ZVAL_STRINGL(tmp, buffer, buffer_len, 1); zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(zval *), NULL); } + efree(buffer); } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php