explicit type check

If $format = '', then the first check is included in the second.
Also, if a file extension "foo.0" were to be uploaded, ("0" == false) evaluates as true.