From: Zeev Suraski Date: Tue, 11 May 1999 16:52:58 +0000 (+0000) Subject: * Move unclean_shutdown from PHP to Zend. X-Git-Tag: BEFORE_PHP4_APACHE_MODULE_CHANGE~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba88c0c47c1dcbf20a920ccef0e45c7d1d277905;p=php * Move unclean_shutdown from PHP to Zend. * The Master/Local headers in the phpinfo() table were reversed. * Fix a gpc bug --- diff --git a/ext/standard/post.c b/ext/standard/post.c index 8258493213..54ba99b9ea 100644 --- a/ext/standard/post.c +++ b/ext/standard/post.c @@ -212,7 +212,7 @@ void _php3_parse_gpc_data(char *val, char *var, pval *track_vars_array) val_len = strlen(val); if (PG(magic_quotes_gpc)) { - val = _php3_addslashes(val, val_len, NULL, 0); + val = _php3_addslashes(val, val_len, &val_len, 0); } else { val = estrndup(val, val_len); } diff --git a/ext/standard/string.c b/ext/standard/string.c index d87b57cf30..d809349bb6 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1160,7 +1160,9 @@ PHPAPI char *_php3_addslashes(char *str, int length, int *new_length, int should } } *target = 0; - if(new_length) *new_length = target - new_str; + if (new_length) { + *new_length = target - new_str; + } if (should_free) { STR_FREE(str); } diff --git a/main/main.c b/main/main.c index 831d3431f2..2f2d0d6508 100644 --- a/main/main.c +++ b/main/main.c @@ -599,8 +599,6 @@ static void php_message_handler_for_zend(long message, void *data) int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) { - PG(unclean_shutdown) = 0; - zend_output_startup(); #if APACHE @@ -675,7 +673,7 @@ void php_request_shutdown(void *dummy) sapi_deactivate(SLS_C); php3_destroy_request_info(NULL); - shutdown_memory_manager(PG(unclean_shutdown), 0); + shutdown_memory_manager(CG(unclean_shutdown), 0); php3_unset_timeout(); @@ -1151,7 +1149,6 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ } if (setjmp(EG(bailout))!=0) { - PG(unclean_shutdown) = 1; return; } _php3_hash_environment(PLS_C ELS_CC); @@ -1178,8 +1175,6 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ if (EG(main_op_array)) { EG(active_op_array) = EG(main_op_array); zend_execute(EG(main_op_array) ELS_CC); - } else { - PG(unclean_shutdown) = 1; } } @@ -1207,7 +1202,7 @@ PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mo php3_TreatHeaders(); file_handle.type = ZEND_HANDLE_FD; file_handle.handle.fd = fd; - file_handle.filename = request_info.filename; + file_handle.filename = SG(request_info).path_translated; (void) php_execute_script(&file_handle CLS_CC ELS_CC); php3_header(); /* Make sure headers have been sent */ diff --git a/main/php_globals.h b/main/php_globals.h index 0eae5e131c..ea2597e6a6 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -64,7 +64,6 @@ struct _php_core_globals { long y2k_compliance; unsigned char header_is_being_sent; - unsigned char unclean_shutdown; }; diff --git a/main/php_ini.c b/main/php_ini.c index 56f48f1c66..b96188d525 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -338,7 +338,7 @@ PHPAPI void display_ini_entries(zend_module_entry *module) module_number = 0; } PUTS("\n"); - php_info_print_table_header(3, "Directive", "Master Value", "Local Value"); + php_info_print_table_header(3, "Directive", "Local Value", "Master Value"); zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) php_ini_displayer, (void *) module_number); PUTS("
\n"); }