From 365f385ca33615e27c42824e87ffce1757828297 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Fri, 20 Mar 2009 07:46:02 +0000 Subject: [PATCH] Check for alphanumeric entry --- webui/user-add.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webui/user-add.php b/webui/user-add.php index c27a4ad2..2879eacf 100644 --- a/webui/user-add.php +++ b/webui/user-add.php @@ -60,6 +60,11 @@ if ($_POST['frmaction'] == "add") { if (empty($_POST['user_name'])) { ?> <div class="warning">Username cannot be empty</div> +<?php + } + else if (!preg_match('/^[a-z0-9]+$/i', $_POST['user_name'])) { +?> + <div class="warning">Username invalid: must be alphanumeric</div> <?php # Add to database } else { -- GitLab