mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Explicitly sanitize '?' from path
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
- Report dictionary to InfoTool
|
||||
- Even even stricter copy protection output
|
||||
- Disable PVD creation for Aaru
|
||||
- Explicitly sanitize '?' from path
|
||||
|
||||
### 2.3 (2022-02-05)
|
||||
- Start overhauling Redump information pulling, again
|
||||
|
||||
@@ -1177,9 +1177,13 @@ namespace MPF.Library
|
||||
.Replace(':', '_', 0, directory.LastIndexOf(':') == -1 ? 0 : directory.LastIndexOf(':'))
|
||||
.ToString();
|
||||
|
||||
// Sanitize everything else
|
||||
// Sanitize the directory path
|
||||
directory = directory.Replace('?', '_');
|
||||
foreach (char c in Path.GetInvalidPathChars())
|
||||
directory = directory.Replace(c, '_');
|
||||
|
||||
// Sanitize the filename
|
||||
filename = filename.Replace('?', '_');
|
||||
foreach (char c in Path.GetInvalidFileNameChars())
|
||||
filename = filename.Replace(c, '_');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user