Skip to content

Commit 40cd1d4

Browse files
committed
MFH fix #46005
1 parent 5856a68 commit 40cd1d4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: sapi/apache2filter/sapi_apache2.c

+4
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
427427
if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) {
428428
auth = apr_table_get(f->r->headers_in, "Authorization");
429429
php_handle_auth_data(auth TSRMLS_CC);
430+
if (SG(request_info).auth_user == NULL && f->r->user) {
431+
SG(request_info).auth_user = estrdup(f->r->user);
432+
}
433+
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
430434
} else {
431435
SG(request_info).auth_user = NULL;
432436
SG(request_info).auth_password = NULL;

Diff for: sapi/apache2handler/sapi_apache2.c

+3
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
472472
if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) {
473473
auth = apr_table_get(r->headers_in, "Authorization");
474474
php_handle_auth_data(auth TSRMLS_CC);
475+
if (SG(request_info).auth_user == NULL && r->user) {
476+
SG(request_info).auth_user = estrdup(r->user);
477+
}
475478
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
476479
} else {
477480
SG(request_info).auth_user = NULL;

0 commit comments

Comments
 (0)