Character removal bug in 4.9.3

All your suggestions, requests and ideas for future development
Post Reply
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Character removal bug in 4.9.3

Post by rednoah »

What is your custom format?
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Character removal bug in 4.9.3

Post by rednoah »

{t} yields .exe as expected:

Code: Select all

{t}
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:

Code: Select all

{t.removeIllegalCharacters()}

:arrow: You may prefer to explicitly specify exactly what you want to remove via custom regex:

Code: Select all

{t.removeAll(/[!?]/)}
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Character removal bug in 4.9.3

Post 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.


:idea: 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply