Skip to content

A free, self-hostable news aggregator…

Fix multiple auth headers bug (#7703)

Inverle7d9fc0ce0c31
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 9d315a26d..196ab06a4 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -856,7 +856,7 @@ function checkTrustedIP(): bool {
}
function httpAuthUser(bool $onlyTrusted = true): string {
- $auths = array_intersect_key($_SERVER, ['REMOTE_USER' => '', 'REDIRECT_REMOTE_USER' => '', 'HTTP_REMOTE_USER' => '', 'HTTP_X_WEBAUTH_USER' => '']);
+ $auths = array_unique(array_intersect_key($_SERVER, ['REMOTE_USER' => '', 'REDIRECT_REMOTE_USER' => '', 'HTTP_REMOTE_USER' => '', 'HTTP_X_WEBAUTH_USER' => '']));
if (count($auths) > 1) {
Minz_Log::warning('Multiple HTTP authentication headers!');
return '';