There should only be files in the data directory, right? If you still want the precaution, you could still use the ```in_array()``` and ```is_file()``` only if a match is found.