Always perform sanity check in user input. This class will assist you and make your life much easier.