-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix external edit filename sanitising unintentionally dropping folder separators #34945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // if there are further troubles related to similar issues, reevaluate moving this sort of check to the import side instead (sanitising filenames on import from archive). | ||
| string destinationPath = Path.Join(mountedPath, realmFile.Filename.GetValidFilename()); | ||
| string destinationPath = mountedPath; | ||
| foreach (string piece in realmFile.Filename.Split('/').Select(f => f.GetValidFilename())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to be Unix path? In other words, is this correct to not be Path.GetFilenameSeparator() or whatever?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "guarantee" is here:
osu/osu.Game/Database/ModelManager.cs
Line 89 in 71210be
| filename = filename.ToStandardisedPath(); |
We could probably add an assert in RealmNamedFileUsage if that makes things more palatable.
Closes #34929.