diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1332d4c83b..28496a6a98 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.3 (in development) ------------------------------------------------------------------------ - Fix: [#14312] Research ride type message incorrect. +- Fix: [#17763] Missing validation on invalid characters in file name. - Fix: [#17853] Invention name tears while being dragged. - Fix: [#18064] Unable to dismiss notification messages. - Fix: [#18070] Underground entrance/exit shows through terrain walls (original bug). diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 94e85d3375..7830778331 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -575,16 +575,16 @@ static void WindowLoadsaveTextinput(rct_window* w, WidgetIndex widgetIndex, char if (text == nullptr || text[0] == 0) return; + if (!Platform::IsFilenameValid(text)) + { + context_show_error(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + return; + } + switch (widgetIndex) { case WIDX_NEW_FOLDER: { - if (!Platform::IsFilenameValid(text)) - { - context_show_error(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); - return; - } - const u8string path = Path::Combine(_directory, text); if (!Platform::EnsureDirectoryExists(path)) {