6 ms·
I think it's good practice to trim leading/trailing whitespace from all inbound data. Google docs for one usually appends a newline to data kept in cells. Not s
by mbenjaminsmith 16y ago
I think it's good practice to trim leading/trailing whitespace from all inbound data. Google docs for one usually appends a newline to data kept in cells. Not so good if you're keeping passwords in a spreadsheet.
That doesn't address spaces IN passwords, but I know I've never written a script to block them. If I had to guess I would say it depends on individual frameworks or the behavior of individual languages. E.g. python has a decent strip() function, javascript doesn't. If you need to trim whitespace in javascript you need to write a regex. It would be easier to test/remove all whitespace instead of trailing/leading whitespace. Maybe that's a clue.
- ultrasaurus 16y agoI've done it for a similar reason: it cuts down on support requests (ever so slightly). No matter what you tell them, users will store passwords in text files and email them around in spreadsheets, and spaces interfere with cutting and pasting in a way that other characters don't. It's not a strong reason, but no-one's ever complained about not being allowed to use spaces either.
- ericd 16y agoThe advanced ones just silently hate you. It's not an annoyance worth emailing about, but it is an annoyance.