Updates after kkolinko review - Correct comment - Use correct regular expression match (that makes regular expressions an even worse option) - Improve (roughly x2) performance of invalid filename check This is fix 3 of 3 for CVE-2017-12617