Skip to content

Commit

Permalink
fix(desktop-notifications): session gets properly compared again
Browse files Browse the repository at this point in the history
This bug was introduced by commit 6f1ec2d as it started treating the cookies array as a nested array, which it is not. It thus compared the first character of the submitted session identifier against the full identifier in the database.
  • Loading branch information
ncosta-ic committed Nov 29, 2023
1 parent a14d4f9 commit 83392d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Notifications/Daemon/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private function handleRequest(ServerRequestInterface $request): Response

/**
* @param Connection $connection
* @param array<array<string>> $cookies
* @param array<string> $cookies
* @param array<array<string>> $headers
* @return stdClass
*/
Expand All @@ -330,7 +330,7 @@ private function authenticate(Connection $connection, array $cookies, array $hea
// grab session
/** @var Session $session */
$session = Session::on($this->dbLink)
->filter(Filter::equal('php_session_id', htmlspecialchars(trim($cookies['Icingaweb2'][0]))))
->filter(Filter::equal('php_session_id', htmlspecialchars(trim($cookies['Icingaweb2']))))
->first();

// calculate device id
Expand Down

0 comments on commit 83392d5

Please sign in to comment.