librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1836] Disallow underscores in initial and final posit


From: Clint Adams
Subject: [Librefm-commits] [1836] Disallow underscores in initial and final positions of usernames.
Date: Mon, 25 May 2009 02:09:13 +0000

Revision: 1836
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1836
Author:   clint
Date:     2009-05-25 02:09:13 +0000 (Mon, 25 May 2009)
Log Message:
-----------
Disallow underscores in initial and final positions of usernames.

Modified Paths:
--------------
    trunk/nixtape/register.php

Modified: trunk/nixtape/register.php
===================================================================
--- trunk/nixtape/register.php  2009-05-25 02:02:18 UTC (rev 1835)
+++ trunk/nixtape/register.php  2009-05-25 02:09:13 UTC (rev 1836)
@@ -80,8 +80,8 @@
 
 
        //Basic validation
-       if(!preg_match('/^[a-zA-Z0-9_]{3,16}$/', $username)) {
-               $errors .= 'Your username must be atleast 3 characters in 
length (max 16) and only consist of <i>a-z, A-Z, 0-9</i> and _ (underscore).<br 
/>';
+       if(!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9_]{1,14}[a-zA-Z0-9]$/', 
$username)) {
+               $errors .= 'Your username must be at least 3 characters in 
length (max 16) and only consist of <i>a-z, A-Z, 0-9</i> and _ (underscore), 
and may not begin or end with an underscore.<br />';
        }
        if(empty($password)) {
                $errors .= 'You must enter a password.<br />';





reply via email to

[Prev in Thread] Current Thread [Next in Thread]