Browse Source

add node settings username validation

main
ghost 10 months ago
parent
commit
2b1e7369fd
  1. 20
      src/controller/room.php

20
src/controller/room.php

@ -536,20 +536,22 @@ class Room @@ -536,20 +536,22 @@ class Room
return null;
}
// Set timestamp
$time = isset($transaction['time']) ? $transaction['time'] : time();
// Set default username
$user = $this->_config->kevachat->user->name->guest;
// Detect username (key @postfix)
if (preg_match('/@([^@]+)$/', $data['key'], $match))
{
$user = $match[1];
}
else
{
$user = $this->_config->kevachat->user->name->guest;
// Set username on match node settings
if (preg_match($this->_config->kevachat->user->name->regex, $match[1]))
{
$user = $match[1];
}
}
// Return timestamp
$time = isset($transaction['time']) ? $transaction['time'] : time();
// Is raw field request
if ($field)
{

Loading…
Cancel
Save