Skip to content

Commit d3dce9e

Browse files
committed
MFH fix #46005
1 parent eaa3298 commit d3dce9e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

sapi/apache2filter/sapi_apache2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
411411
if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) {
412412
auth = apr_table_get(f->r->headers_in, "Authorization");
413413
php_handle_auth_data(auth TSRMLS_CC);
414+
if (SG(request_info).auth_user == NULL && f->r->user) {
415+
SG(request_info).auth_user = estrdup(f->r->user);
416+
}
417+
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
414418
} else {
415419
SG(request_info).auth_user = NULL;
416420
SG(request_info).auth_password = NULL;

sapi/apache2handler/sapi_apache2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
456456
if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) {
457457
auth = apr_table_get(r->headers_in, "Authorization");
458458
php_handle_auth_data(auth TSRMLS_CC);
459+
if (SG(request_info).auth_user == NULL && r->user) {
460+
SG(request_info).auth_user = estrdup(r->user);
461+
}
459462
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
460463
} else {
461464
SG(request_info).auth_user = NULL;

0 commit comments

Comments
 (0)