]> granicus.if.org Git - php/commitdiff
MFH fix #46005
authorStanislav Malyshev <stas@php.net>
Thu, 18 Dec 2008 14:28:35 +0000 (14:28 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 18 Dec 2008 14:28:35 +0000 (14:28 +0000)
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

index 0b163c8273c008cec60932f33d6d439721af5c42..715ec4a22141cfd55cd172f362088f750f4aadde 100644 (file)
@@ -411,6 +411,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 524a10f52a66bc2acd8468fe6e5308e1ac4333e8..2b58775b6c608865421a7fc808e286041e99c339 100644 (file)
@@ -456,6 +456,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;