Re: Re: Do you trim() usernames and passwords?
| From: | Dotan Cohen | Date: | Tue, 28 Dec 2010 20:30:35 +0000 |
| Subject: | Re: Re: Do you trim() usernames and passwords? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310289@lists.php.net to get a copy of this message | ||
On Tue, Dec 28, 2010 at 22:26, Joshua Kehn <josh.kehn@gmail.com> wrote:
> Educate the users, don't compromise the system. Either go full on and trim everything (I
> don't recommend this) or trim
> nothing. Be consistent in which one you pick.
>
Then how about:
if ($trimmedPassword==$realPassword && $enteredPassword!=$realPassword){
print "<p>Warmer!</p>";
}
I'm kidding. I'll not trim. But if $trimmedUsername !=
$enteredUsername I'll mention that fact to the user and remind him to
be careful to copy exactly what he means to copy. Username only, not
password.
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com