Re: Re: Do you trim() usernames and passwords?
| From: | Dotan Cohen | Date: | Wed, 29 Dec 2010 09:03:26 +0000 |
| Subject: | Re: Re: Do you trim() usernames and passwords? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310313@lists.php.net to get a copy of this message | ||
On Wed, Dec 29, 2010 at 02:46, David Harkness <david.h@highgearmedia.com> wrote:
> To address the OP, I would agree with skipping trim on both the user name
> and password. If it's a copy-paste error, they will try again.
>
They do try again: copying and pasting in the exact same manner. It
keeps happening.
> If you want
> to get fancy, warn when the password starts with or ends with spaces if it
> comes back incorrect, but I think that's probably going to be so rare as not
> to be worth the extra effort.
>
I've changed it to warn client-side (javascript) if there are leading
or trailing spaces in the the username only:
"Your username [begins||ends] with an errant space. Please reenter
your credentials more carefully."
I hope that they figure out to check their passwords as well.
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com