Skip to content

Commit b9cda91

Browse files
committed
unset empty REMOTE_USER. fixes dokuwiki#4348
An empty remote user should not be set at all. Seems like some webservers always set the environment var, even if no authentication happened. I'd argue that this is wrong, but this should fix the behaviour.
1 parent b327c21 commit b9cda91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/auth.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ function auth_setup()
4747
global $plugin_controller;
4848
$AUTH_ACL = [];
4949

50+
// unset REMOTE_USER if empty
51+
if ($INPUT->server->str('REMOTE_USER') === '') {
52+
$INPUT->server->remove('REMOTE_USER');
53+
}
54+
5055
if (!$conf['useacl']) return false;
5156

5257
// try to load auth backend from plugins

0 commit comments

Comments
 (0)