Skip to content

Conversation

@jetrotal
Copy link
Contributor

@jetrotal jetrotal commented Apr 20, 2024

When saving a file, maniacs forces the File in Text/ folder with .txt extension.
Through this PR, if '*' is at the end of filename, the file extension is relaxed.

@jetrotal jetrotal force-pushed the jetrotal---Relax-StringVars-ToFile branch from a836f71 to 99379cc Compare April 20, 2024 21:05
@carstene1ns
Copy link
Member

Does this open an issue with path traversal: ../../../some/file?

@jetrotal
Copy link
Contributor Author

I guess not, the default behavior allows leaving the /text/file.txt by using ../charset/file.txt as a file name.

my code, simply moves the text file from /text/ to the root of the game whenver the filename ends with *

@Ghabry
Copy link
Member

Ghabry commented Apr 20, 2024

In an ideal world where Maniac Patch and TPC are open source and not obfuscated I would suggest to add a new flag to indicate "absolute path". End of rant


This is a bit opinionated but I do not like the *. The typical convention for an absolute path is to prefix it with /. You should be even able to forward such a path directly to OpenOutputStream without removing the slash manually.

Can you add a comment that this is an EasyRPG Extension?

(Also please remove trivial comments like // Remove the last character. Makes the code look less ChatGPT-generated.)

@jetrotal jetrotal force-pushed the jetrotal---Relax-StringVars-ToFile branch 2 times, most recently from 731f1ef to 57c15fc Compare April 20, 2024 23:09
@Ghabry Ghabry added this to the 0.8.1 milestone Apr 20, 2024
@jetrotal jetrotal force-pushed the jetrotal---Relax-StringVars-ToFile branch from b5730fb to b69bdd8 Compare April 20, 2024 23:28
@Ghabry Ghabry added the EasyRPG New functionality exclusive to EasyRPG Player label Apr 20, 2024
When saving a file, maniacs forces the File in Text/ folder with .txt extension.
Through this PR, if '*' is at the end of filename, the file extension is relaxed.

It also better handles the creation of nested directories.
@Ghabry Ghabry force-pushed the jetrotal---Relax-StringVars-ToFile branch from b69bdd8 to d516336 Compare May 9, 2024 20:45
@Ghabry Ghabry merged commit 2721218 into EasyRPG:master May 9, 2024
@jetrotal jetrotal deleted the jetrotal---Relax-StringVars-ToFile branch August 4, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EasyRPG New functionality exclusive to EasyRPG Player

Development

Successfully merging this pull request may close these issues.

3 participants