Browse Source

add node settings username validation

main
ghost 9 months ago
parent
commit
8dc01763bf
  1. 14
      src/Controller/RoomController.php

14
src/Controller/RoomController.php

@ -1158,15 +1158,17 @@ class RoomController extends AbstractController @@ -1158,15 +1158,17 @@ class RoomController extends AbstractController
return null;
}
// Set default username
$user = $this->getParameter('app.add.user.name.anon');
// Detect username (key @postfix)
if (preg_match('/@([^@]+)$/', $data['key'], $match))
{
$user = $match[1];
}
else
{
$user = $this->getParameter('app.add.user.name.anon');
// Set username on match node settings
if (preg_match($this->getParameter('app.add.user.name.regex'), $match[1]))
{
$user = $match[1];
}
}
return (object)

Loading…
Cancel
Save