summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-07-04 18:03:45 +0400
committerDmitry Stogov <dmitry@zend.com>2014-07-04 18:03:45 +0400
commit6bf24f4dd01331122a0f10db392c08605f159826 (patch)
tree7fe575ead375355aab6c9b2c8a1593642d658406 /main
parentd2890963e4540a20954afae0e059810312c9dc4e (diff)
downloadphp-git-6bf24f4dd01331122a0f10db392c08605f159826.tar.gz
Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data)
Diffstat (limited to 'main')
-rw-r--r--main/main.c25
-rw-r--r--main/php_variables.c3
2 files changed, 15 insertions, 13 deletions
diff --git a/main/main.c b/main/main.c
index ca25e17113..e66ec77532 100644
--- a/main/main.c
+++ b/main/main.c
@@ -897,12 +897,16 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
efree(docref_buf);
}
- if (PG(track_errors) && module_initialized &&
+ if (PG(track_errors) && module_initialized && EG(valid_symbol_table) &&
(Z_TYPE(EG(user_error_handler)) == IS_UNDEF || !(EG(user_error_handler_error_reporting) & type))) {
zval tmp;
ZVAL_STRINGL(&tmp, buffer, buffer_len);
- if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0 TSRMLS_CC) == FAILURE) {
- zval_ptr_dtor(&tmp);
+ if (EG(current_execute_data)) {
+ if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0 TSRMLS_CC) == FAILURE) {
+ zval_ptr_dtor(&tmp);
+ }
+ } else {
+ zend_hash_str_update_ind(&EG(symbol_table).ht, "php_errormsg", sizeof("php_errormsg")-1, &tmp);
}
}
if (replace_buffer) {
@@ -1227,16 +1231,16 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
return;
}
- if (PG(track_errors) && module_initialized) {
- if (!EG(active_symbol_table)) {
- zend_rebuild_symbol_table(TSRMLS_C);
- }
- if (EG(active_symbol_table)) {
- zval tmp;
- ZVAL_STRINGL(&tmp, buffer, buffer_len);
+ if (PG(track_errors) && module_initialized && EG(valid_symbol_table)) {
+ zval tmp;
+
+ ZVAL_STRINGL(&tmp, buffer, buffer_len);
+ if (EG(current_execute_data)) {
if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0 TSRMLS_CC) == FAILURE) {
zval_ptr_dtor(&tmp);
}
+ } else {
+ zend_hash_str_update_ind(&EG(symbol_table).ht, "php_errormsg", sizeof("php_errormsg")-1, &tmp);
}
}
@@ -2125,7 +2129,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#endif
EG(bailout) = NULL;
EG(error_reporting) = E_ALL & ~E_NOTICE;
- EG(active_symbol_table) = NULL;
PG(header_is_being_sent) = 0;
SG(request_info).headers_only = 0;
SG(request_info).argv0 = NULL;
diff --git a/main/php_variables.c b/main/php_variables.c
index 30a84822af..8fa48b2889 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -110,8 +110,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
}
/* GLOBALS hijack attempt, reject parameter */
- if (symtable1 && EG(active_symbol_table) &&
- symtable1 == &EG(active_symbol_table)->ht &&
+ if (symtable1 == &EG(symbol_table).ht &&
var_len == sizeof("GLOBALS")-1 &&
!memcmp(var, "GLOBALS", sizeof("GLOBALS")-1)) {
zval_dtor(val);