From f47589324390a774eac14e2c1efb2c693ec82520 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Mon, 21 Oct 2024 18:27:58 +0800 Subject: [PATCH] FIX:illegal plate name should include escape characters jira: STUDIO-8511 Change-Id: I4ce2b40117b80d98d004d99757b7d74f7ad5b5ec --- src/slic3r/GUI/Plater.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 600523b21..363be831d 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -200,13 +200,18 @@ bool Plater::has_illegal_filename_characters(const std::string& name) for (size_t i = 0; i < std::strlen(illegal_characters); i++) if (name.find_first_of(illegal_characters[i]) != std::string::npos) return true; - + std::array escape_characters = {"<", ">", "&", """, "'"}; + for (auto escape : escape_characters) { + if (boost::contains(name, escape)) { + return true; + } + } return false; } void Plater::show_illegal_characters_warning(wxWindow* parent) { - show_error(parent, _L("Invalid name, the following characters are not allowed:") + " <>:/\\|?*\""); + show_error(parent, _L("Invalid name, the following characters are not allowed:") + " <>:/\\|?*\"" +_L("(Including its escape characters)")); } enum SlicedInfoIdx