add Unittest for traffic-filtering by customer-name, refs #894

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2020-10-31 15:53:07 +01:00
parent 6bf5eccc24
commit 16eca628dd
9 changed files with 41 additions and 26 deletions

View File

@@ -4,6 +4,12 @@ namespace Froxlor\Validate;
class Validate
{
const REGEX_DIR = '/^|(\/[\w-]+)+$/';
const REGEX_PORT = '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di';
const REGEX_CONF_TEXT = '/^[^\0]*$/';
/**
* Validates the given string by matching against the pattern, prints an error on failure and exits
*