librefm-commits
[Top][All Lists]
Advanced

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

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


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

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

Ticket Links:
:-----------
    http://savannah.gnu.org/bugs/?26555

Modified Paths:
--------------
    branches/stable/nixtape/register.php

Modified: branches/stable/nixtape/register.php
===================================================================
--- branches/stable/nixtape/register.php        2009-05-25 02:09:13 UTC (rev 
1836)
+++ branches/stable/nixtape/register.php        2009-05-25 02:09:51 UTC (rev 
1837)
@@ -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]