From a3f2cce4aa1e3ceab15085f5f8986d8d695a13e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Paix=C3=A3o?= Date: Mon, 18 Mar 2019 18:54:13 -0300 Subject: [PATCH] -- Fix Create Account (Compatibility OTHire) (#350) --- register.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/register.php b/register.php index 86be467..3996ba1 100644 --- a/register.php +++ b/register.php @@ -36,9 +36,14 @@ if (empty($_POST) === false) { if ($isNoob) { $errors[] = 'This account name is blocked for registration.'; } - if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) { - $errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.'; - } + if ($config['ServerEngine'] !== 'OTHIRE') { + if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) { + $errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.'; + } + } else { + if (preg_match("/^[0-9]+$/", $_POST['username']) == false) { + $errors[] = 'Your account can only contain numbers 0-9.'; + } // name restriction $resname = explode(" ", $_POST['username']); foreach($resname as $res) {