diff options
Diffstat (limited to 'sapi/apache')
| -rw-r--r-- | sapi/apache/mod_php5.c | 16 | ||||
| -rw-r--r-- | sapi/apache/php_apache.c | 19 |
2 files changed, 12 insertions, 23 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 0f69aeeabd..11be0ed222 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -278,9 +278,6 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ if (track_vars_array) { symbol_table = track_vars_array->value.ht; - } else if (PG(register_globals)) { - /* should never happen nowadays */ - symbol_table = EG(active_symbol_table); } else { symbol_table = NULL; } @@ -310,10 +307,8 @@ static int php_apache_startup(sapi_module_struct *sapi_module) /* {{{ php_apache_log_message */ -static void php_apache_log_message(char *message) +static void php_apache_log_message(char *message TSRMLS_DC) { - TSRMLS_FETCH(); - if (SG(server_context)) { #if MODULE_MAGIC_NUMBER >= 19970831 aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message); @@ -332,7 +327,7 @@ static void php_apache_request_shutdown(void *dummy) { TSRMLS_FETCH(); - php_output_set_status(0 TSRMLS_CC); + php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC); if (AP(in_request)) { AP(in_request) = 0; php_request_shutdown(dummy); @@ -443,9 +438,9 @@ static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) /* {{{ php_apache_get_request_time */ -static time_t php_apache_get_request_time(TSRMLS_D) +static double php_apache_get_request_time(TSRMLS_D) { - return ((request_rec *)SG(server_context))->request_time; + return (double) ((request_rec *)SG(server_context))->request_time; } /* }}} */ @@ -504,6 +499,7 @@ static sapi_module_struct apache_sapi_module = { NULL, /* treat data */ NULL, /* exe location */ 0, /* ini ignore */ + 0, /* ini ignore cwd */ sapi_apache_get_fd, sapi_apache_force_http_10, sapi_apache_get_target_uid, @@ -545,7 +541,7 @@ static void init_request_info(TSRMLS_D) SG(request_info).auth_password = NULL; SG(request_info).auth_digest = NULL; - if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) { + if (authorization) { char *p = getword(r->pool, &authorization, ' '); if (!strcasecmp(p, "Basic")) { tmp = uudecode(r->pool, authorization); diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index abfdbdea52..3745197439 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -272,7 +272,7 @@ PHP_MINFO_FUNCTION(apache) env_arr = table_elts(r->headers_in); env = (table_entry *)env_arr->elts; for (i = 0; i < env_arr->nelts; ++i) { - if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) { + if (env[i].key) { php_info_print_table_row(2, env[i].key, env[i].val); } } @@ -350,7 +350,7 @@ PHP_FUNCTION(virtual) int filename_len; request_rec *rr = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { return; } @@ -368,7 +368,7 @@ PHP_FUNCTION(virtual) RETURN_FALSE; } - php_end_ob_buffers(1 TSRMLS_CC); + php_output_end_all(TSRMLS_C); php_header(TSRMLS_C); if (run_sub_req(rr)) { @@ -401,9 +401,7 @@ PHP_FUNCTION(apache_request_headers) env_arr = table_elts(((request_rec *) SG(server_context))->headers_in); tenv = (table_entry *)env_arr->elts; for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key || - (PG(safe_mode) && - !strncasecmp(tenv[i].key, "authorization", 13))) { + if (!tenv[i].key) { continue; } if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { @@ -533,14 +531,14 @@ PHP_FUNCTION(apache_lookup_uri) #if 0 +/* This function is most likely a bad idea. Just playing with it for now. - +*/ PHP_FUNCTION(apache_exec_uri) { char *filename; int filename_len; request_rec *rr=NULL; - TSRMLS_FETCH(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { return; @@ -594,11 +592,6 @@ PHP_FUNCTION(apache_get_modules) Reset the Apache write timer */ PHP_FUNCTION(apache_reset_timeout) { - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode"); - RETURN_FALSE; - } - ap_reset_timeout((request_rec *)SG(server_context)); RETURN_TRUE; } |
