Page 1 of 1
Re: Character removal bug in 4.9.3
Posted: 24 Feb 2021, 03:31
by rednoah
What is your custom format?
Re: Character removal bug in 4.9.3
Posted: 25 Feb 2021, 06:33
by rednoah
{t} yields
.exe as expected:
After removing illegal characters the result is
exe which is expected too
(file names must not start with . because that denotes hidden files) but perhaps isn't exactly what you want in this particular use case:

You may prefer to explicitly specify exactly what you want to remove via custom regex:
Re: Character removal bug in 4.9.3
Posted: 26 Feb 2021, 09:54
by rednoah
Xiphan wrote: ↑25 Feb 2021, 20:37
As for the filename beginning with a period there seems to be logic in the code for 4.9.2 that realises {t} is not the start of the file so it doesn't remove the leading period. Nevertheless...
Previous revisions just didn't account for leading . at all, allowing Linux and Mac users to accidentally create hidden files and folders
(e.g. if the series name starts with . then series folder disappears) which is now fixed.
String.removeIllegalCharacters() can't know the context in which it is used. Internally, it's used for validating file names as best as possible, which now includes stripping leading . as well.