PHP validator that checks if a given string is a valid/allowed filesystem path across operating systems