Change path validation according to mozilla's standard.