mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Fix: ws session extraction
This commit is contained in:
parent
6bdfe87bc0
commit
bb093482a7
@ -271,12 +271,20 @@ class WSManager extends WebSocketServer
|
||||
{
|
||||
global $config;
|
||||
|
||||
$php_session_id = \str_replace(
|
||||
'PHPSESSID=',
|
||||
'',
|
||||
$user->headers['cookie']
|
||||
$match;
|
||||
$php_session_id = '';
|
||||
\preg_match(
|
||||
'/PHPSESSID=(.*)/',
|
||||
$user->headers['cookie'],
|
||||
$match
|
||||
);
|
||||
|
||||
if (is_array($match) === true) {
|
||||
$php_session_id = $match[1];
|
||||
}
|
||||
|
||||
$php_session_id = \preg_replace('/;.*$/', '', $php_session_id);
|
||||
|
||||
// If being redirected from proxy.
|
||||
if (isset($user->headers['x-forwarded-for']) === true) {
|
||||
$user->address = $user->headers['x-forwarded-for'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user