]> granicus.if.org Git - php/commitdiff
Avoid generating php_errormsg twice in some instances.
authorIlia Alshanetsky <iliaa@php.net>
Mon, 18 Sep 2006 23:08:36 +0000 (23:08 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 18 Sep 2006 23:08:36 +0000 (23:08 +0000)
main/main.c

index aefeeb1a4bb95c4c8dc3bafd3e7353431e0a2859..b9249ba4f092748b1e351776d08483e538a94f50 100644 (file)
@@ -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);
 }
 /* }}} */