I have a form which will (once it is actually written) take either an IP address or a hostname and begin doing things with it. But before I can do anything with it it has to get untainted. I have got this check
but it only works on some hosts (host.com or host.ca but not thing.host.com nor thing.org.uk) any thoughts on how to clean this up a bit or a way to tighten down the check?
all code is tested, and doesn't work so there :p (varient on common PM sig for my own ammusment)