BZ1006506 - File name validation broken
(cherry picked from commit 21ece6ecf8723dddaa14e2531802253335eadecf)