PuzzleScript
PuzzleScript copied to clipboard
Weird game titles can cause game exports to have a .txt extension
For example, calling a game just <
will cause the export download filename to be html.txt
instead of a file with the HTML extension. The exported file is actual HTML, but the extension is incorrect.
Might be (loosely) related to #932?
Sorry for the tardy reply, but could you let me know what browser + OS you were using? (I just tried it on MacOS 13.2.1 with Safari Version 16.3 (18614.4.6.1.6), and Chrome 110.0.5481.177, and now I have "<.html" and "_.html" respectively in my downloads folder).
I can still reproduce this issue on Windows 10 with Firefox 110.0.1 (64-bits).
Just hypothesizing, but I'm not sure if the reserved filename characters are the same between Windows and MacOS, and that the browser thus handles it differently? For example, <
is a reserved character on Windows, but seems allowed in MacOS.
As far as I know, this is probably not a bug. It is the browser which has to handle file names, according to the operating system, and if a web page or HTTP server specifies a file name which is not valid then it will be necessary for the browser to change it (or to allow the user to specify a different file name).
In my opinion the exported filename should be sanitised, replacing risky characters by something safer. I've done this with PS Next.
The choice of risky characters IMO should allow games to be exported so 'it just works' on any browser, any O/S.