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