cantineNantes / mustached-robot

Mustached Robot is an open-source checkin plateform for coworking spaces (currently under development).
http://www.mustached-robot.org
11 stars 4 forks source link

On User/Account/Add form, don't fill Company field = error. #19

Closed fgosselin closed 12 years ago

fgosselin commented 12 years ago

Company field is not a required field. But if a user don't fill it, you get this : (Bug Screenshot) http://cl.ly/image/0a1Y211Q022d

hashar commented 12 years ago

And you should probably not use empty() there.

$password is passed via trim() so you should compare: $password === ''

It is probably the same with username.

$email is validated via filter_var() which returns false whenever filter fail, so you should use $email === false instead.

empty() is definitely evil, you should really almost never use it.

dzey commented 12 years ago

@hashar thanks for your reply. This specific code comes from the FuelPHP SimpleAuth package, so I guess you could ping them about your feedback : https://github.com/fuel/auth/blob/1.3/master/classes/auth/login/simpleauth.php