]> granicus.if.org Git - php/commitdiff
MFH fix #46005
authorStanislav Malyshev <stas@php.net>
Wed, 17 Dec 2008 11:34:50 +0000 (11:34 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 17 Dec 2008 11:34:50 +0000 (11:34 +0000)
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

index ecd1eb624d170b958b4a84106b649a6a06f61968..4e3efffdc4ab7afa0738e9a2b43da38b7db269a6 100644 (file)
@@ -427,6 +427,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
        if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) {
                auth = apr_table_get(f->r->headers_in, "Authorization");
                php_handle_auth_data(auth TSRMLS_CC);
+               if (SG(request_info).auth_user == NULL && f->r->user) {
+                       SG(request_info).auth_user = estrdup(f->r->user);
+               }
+               ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
        } else {
                SG(request_info).auth_user = NULL;
                SG(request_info).auth_password = NULL;
index cf2e1427bebfb616c4ff09bbce8499aa718157c2..a34a9399fa25f88b91d081e9110c0dd6ac9d2424 100644 (file)
@@ -472,6 +472,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
        if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) {
                auth = apr_table_get(r->headers_in, "Authorization");
                php_handle_auth_data(auth TSRMLS_CC);
+               if (SG(request_info).auth_user == NULL && r->user) {
+                       SG(request_info).auth_user = estrdup(r->user);
+               }
                ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
        } else {
                SG(request_info).auth_user = NULL;