I noticed that - historically - setDownload() could also be used with
false, true, or other weird values to activate a download filename.
So, this change continues to give full compatibility to PHP 8.1 but
with extra validations.
This also adds a bit of inline documentation to put this more explicit.
For more context see the previous version:
rP5952b0a31b6a: Stop mangling filenames when downloading them
rP96ae4ba13acb: PHP 8.1: fixes for strlen() not accepting NULL anymore, part 2
Ref T15190