mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-09 14:27:58 +00:00
add legacy usernames backport
This commit is contained in:
parent
8250a2f045
commit
8b1cb0acdd
@ -825,7 +825,7 @@ class RoomController extends AbstractController
|
|||||||
private function _post(array $data): ?object
|
private function _post(array $data): ?object
|
||||||
{
|
{
|
||||||
// Validate key format allowed in settings
|
// Validate key format allowed in settings
|
||||||
if (false === preg_match((string) $this->getParameter('app.add.post.key.regex'), $data['key'], $matches))
|
if (!preg_match((string) $this->getParameter('app.add.post.key.regex'), $data['key'], $matches))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -842,8 +842,14 @@ class RoomController extends AbstractController
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Legacy usernames backport
|
||||||
|
if (!preg_match((string) $this->getParameter('app.add.user.name.regex'), $matches[2]))
|
||||||
|
{
|
||||||
|
$matches[2] = 'anon';
|
||||||
|
}
|
||||||
|
|
||||||
// Validate value format allowed in settings
|
// Validate value format allowed in settings
|
||||||
if (false === preg_match((string) $this->getParameter('app.add.post.value.regex'), $data['value']))
|
if (!preg_match((string) $this->getParameter('app.add.post.value.regex'), $data['value']))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user