Skip to content

Commit

Permalink
System: Ensure titles are sanitized for screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jun 28, 2024
1 parent 41f4024 commit 3877486
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4764,13 +4764,13 @@ bool System::SaveScreenshot(const char* filename, DisplayScreenshotMode mode, Di
std::string auto_filename;
if (!filename)
{
const std::string& name = System::GetGameTitle();
const std::string sanitized_name = Path::SanitizeFileName(System::GetGameTitle());
const char* extension = Settings::GetDisplayScreenshotFormatExtension(format);
std::string basename;
if (name.empty())
if (sanitized_name.empty())
basename = fmt::format("{}", GetTimestampStringForFileName());
else
basename = fmt::format("{} {}", name, GetTimestampStringForFileName());
basename = fmt::format("{} {}", sanitized_name, GetTimestampStringForFileName());

auto_filename = fmt::format("{}" FS_OSPATH_SEPARATOR_STR "{}.{}", EmuFolders::Screenshots, basename, extension);

Expand Down

0 comments on commit 3877486

Please sign in to comment.