Browse Source

update namespace regex

main
ghost 1 year ago
parent
commit
a04a493ac3
  1. 2
      src/Controller/ModuleController.php
  2. 4
      src/Controller/RoomController.php
  3. 2
      src/Twig/AppExtension.php

2
src/Controller/ModuleController.php

@ -108,7 +108,7 @@ class ModuleController extends AbstractController @@ -108,7 +108,7 @@ class ModuleController extends AbstractController
}
// Append custom valid namespace to the rooms list menu
if (!in_array($request->get('namespace'), $list) && preg_match('/^[A-z0-9]{34}$/', $request->get('namespace')))
if (!in_array($request->get('namespace'), $list) && preg_match('/^N[A-z0-9]{33}$/', $request->get('namespace')))
{
$list[] = $request->get('namespace');
}

4
src/Controller/RoomController.php

@ -136,7 +136,7 @@ class RoomController extends AbstractController @@ -136,7 +136,7 @@ class RoomController extends AbstractController
name: 'room_namespace',
requirements:
[
'namespace' => '^[A-z0-9]{34}$',
'namespace' => '^N[A-z0-9]{33}$',
'txid' => '^[A-z0-9]{64}$',
],
defaults:
@ -298,7 +298,7 @@ class RoomController extends AbstractController @@ -298,7 +298,7 @@ class RoomController extends AbstractController
name: 'room_post',
requirements:
[
'namespace' => '^[A-z0-9]{34}$',
'namespace' => '^N[A-z0-9]{33}$',
],
methods:
[

2
src/Twig/AppExtension.php

@ -185,7 +185,7 @@ class AppExtension extends AbstractExtension @@ -185,7 +185,7 @@ class AppExtension extends AbstractExtension
): string
{
// Validate namespace supported to continue
if (!preg_match('/^[A-z0-9]{34}$/', $namespace))
if (!preg_match('/^N[A-z0-9]{33}$/', $namespace))
{
return $namespace;
}

Loading…
Cancel
Save