]> granicus.if.org Git - php/commitdiff
Fixed bug #17662
authorIlia Alshanetsky <iliaa@php.net>
Mon, 23 Sep 2002 04:10:25 +0000 (04:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 23 Sep 2002 04:10:25 +0000 (04:10 +0000)
sapi/apache2filter/sapi_apache2.c

index b89784008ccc0ad8ac9166702274348c818f678f..db396ace0cf00e90ffd223f51b3ffbc6aa87c53a 100644 (file)
@@ -161,6 +161,17 @@ php_apache_sapi_read_cookies(TSRMLS_D)
        return (char *) http_cookie;
 }
 
+static char *
+php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
+{
+       php_struct *ctx = SG(server_context);
+       const char *env_var;
+       
+       env_var = apr_table_get(ctx->r->subprocess_env, name);
+
+       return (char *) env_var;
+}
+
 static void
 php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
 {
@@ -254,7 +265,7 @@ static sapi_module_struct apache2_sapi_module = {
        php_apache_sapi_ub_write,                               /* unbuffered write */
        php_apache_sapi_flush,                                  /* flush */
        NULL,                                                                   /* get uid */
-       NULL,                                                                   /* getenv */
+       php_apache_sapi_getenv,                                 /* getenv */
 
        php_error,                                                              /* error handler */