summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-09-18 23:08:36 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-09-18 23:08:36 +0000
commitfe6effeeb4d155391831e27f7332630a135c3004 (patch)
tree8eae01423b64bfd989298f8ba3a0e6e458d1c6c3
parent3bd1c646b77ef9fbc100554edd329dbebf0c2738 (diff)
downloadphp-git-fe6effeeb4d155391831e27f7332630a135c3004.tar.gz
Avoid generating php_errormsg twice in some instances.
-rw-r--r--main/main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/main/main.c b/main/main.c
index aefeeb1a4b..b9249ba4f0 100644
--- a/main/main.c
+++ b/main/main.c
@@ -572,7 +572,8 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
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 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
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);
}
/* }}} */