]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update Session.php 30727/head
authorMarek-Wojtowicz <54400070+Marek-Wojtowicz@users.noreply.github.com>
Tue, 11 Jan 2022 21:33:18 +0000 (22:33 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 17 Jan 2022 23:23:08 +0000 (23:23 +0000)
The http headers according to rfc 2616 is iso-8859-1. This patch fixes the behavior when non-ascii characters are present in the header.

Signed-off-by: Marek Wójtowicz <Marek.Wojtowicz@agh.edu.pl>
lib/private/User/Session.php

index 710cba84879af4a37d395a418a738e38134c4334..7aea219b6089e42bb350f8bc5e9d687d929e228b 100644 (file)
@@ -681,7 +681,7 @@ class Session implements IUserSession, Emitter {
                        // User does not exist
                        return false;
                }
-               $name = isset($request->server['HTTP_USER_AGENT']) ? $request->server['HTTP_USER_AGENT'] : 'unknown browser';
+               $name = isset($request->server['HTTP_USER_AGENT']) ? utf8_encode($request->server['HTTP_USER_AGENT']) : 'unknown browser';
                try {
                        $sessionId = $this->session->getId();
                        $pwd = $this->getPassword($password);