summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
/* }}} */