Refactored: beberlei pointed me to some strange behaviors of filter_var(). So I adapted SF2 code for a more secure assertion.