Hey Everyone,
I'm looking for feedback on a fairly substantial bit of code today. It's called UserCake, and it's meant as a simple frame work for sites requiring user management and limited access pages. I didn't start it, but it's been around for a while, and I've taken over running the project. We've just got it to the point where we're Beta Testing 2.0 -- and that's what I'm asking you all to look at.
If you don't have time to look through the entire code base, I'm particularly interested in feedback on the functions file. models/funcs.php
Are you missing the "global" keyword on line 58 of said file?
/!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade!/!!!\ ereg() is deprecated --- don't use it!
dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket
Looks like you've fallen into the trap of using regular expressions for email validation. The isValidEmail() function doesn't even validate the fairly popular 'forename.surname@somedomain.co.uk' address format (particularly common in large organisations/universities/etc, where people will have common names), let alone some of the more complicated and perfectly valid ones. I would definitely expand on that function a bit, and try to refer to the email format RFCs when you do update it.
I wouldn't; I'd get rid of it altogether and instead use filter_var().
Keep the function as a wrapper for it, as that allows you to easily expand the function later, such as to allow a check on the domain for validity, or see if the email responds to a HELO request.
Bookmarks