Closed icarus31 closed 2 months ago
Hi @icarus31, thanks for opening up this issue.
IIRC the filename
is a parameter provided by the developer using the framework (in this case is you). Is there a specific reason why the sanitization of the file name should not happen outside of the framework, and become a responsibility of TPPDF?
IMHO using a filename without the directory separator /
is general best practice and not a particular job of TPPDF, but I am open for discussion
You are right, please ignore that enhancement. Regards
How should the feature work?
When calling the generateURL() function, an extra parameter could be used to convert invalid character to that one. A default character (ex: "-") will be used if not provided.
What should it look like?
I guess a better solution would probably be to check for all invalid characters and replace them with the separator.
For example, if the file name has a slash "/" character, "myfile/name" would be replaced by "myfile-name" if nothing has been provided.
What happened instead?
If nothing to replace, the current code stays the same
This is just a suggestion. I will now protect my self to avoid the crash.