1 (edited by addicted68098 2006-02-16 04:51)

Topic: Username Validation Error

I was doing some testing and discovered that a two character username is accepted valid,

    if (strlen($username) < 2)
        message($lang_prof_reg['Username too short']);
    else if (pun_strlen($username) > 25)    // This usually doesn't happen since the form element only accepts 25 characters

Also there is no censory validation on the username, I am not 100% sure, it seems completly valid, but here is a user i made up, http://levade.homeip.net/addicted/forum … .php?id=12

passwords seem to work fine

Main
Forums
Future

2

Re: Username Validation Error

addicted68098 wrote:

I was doing some testing and discovered that a two character username is accepted valid

Yes, usernames are between 2 and 25 characters...

Re: Username Validation Error

I'm curious, how is this a bug?

And yes, usernames are censored if you have censoring enabled.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Username Validation Error

Rickard wrote:

I'm curious, how is this a bug?

And yes, usernames are censored if you have censoring enabled.

thanks, that explains why that didn't work, i never thought it was an option, anyways i just read it wronge, i thought it would have to be <=2 or something simular to allow 2 characters, i guess I am new to php, so I really wouldn't know.

Main
Forums
Future

Re: Username Validation Error

<= 2 would mean that, to trigger the error, the name would need to be less than or equal to 2 characters in length. Which would mean the error would trigger for 2 letter usernames, which it shouldn't tongue

Re: Username Validation Error

http://be2.php.net/operators.comparison
This link may help you understand better smile