PuzzleScript icon indicating copy to clipboard operation
PuzzleScript copied to clipboard

Weird game titles can cause game exports to have a .txt extension

Open Auroriax opened this issue 1 year ago • 4 comments

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?

Auroriax avatar Jul 20 '22 20:07 Auroriax

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

increpare avatar Mar 10 '23 11:03 increpare

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.

Auroriax avatar Mar 14 '23 21:03 Auroriax

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

zzo38 avatar Aug 28 '23 04:08 zzo38

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.

david-pfx avatar Aug 28 '23 05:08 david-pfx