From 33175a02f37b588654ce7fe294b38863072e9aa5 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 23 Jul 2018 10:58:39 +0200 Subject: [PATCH] Added xml escape characters detection when exporting object and columes names to amf files --- xs/src/libslic3r/Format/AMF.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xs/src/libslic3r/Format/AMF.cpp b/xs/src/libslic3r/Format/AMF.cpp index 21d4b4d3b..be513166e 100644 --- a/xs/src/libslic3r/Format/AMF.cpp +++ b/xs/src/libslic3r/Format/AMF.cpp @@ -761,7 +761,7 @@ bool store_amf(const char *path, Model *model, Print* print, bool export_print_c for (const std::string &key : object->config.keys()) stream << " " << object->config.serialize(key) << "\n"; if (!object->name.empty()) - stream << " " << object->name << "\n"; + stream << " " << xml_escape(object->name) << "\n"; std::vector layer_height_profile = object->layer_height_profile_valid ? object->layer_height_profile : std::vector(); if (layer_height_profile.size() >= 4 && (layer_height_profile.size() % 2) == 0) { // Store the layer height profile as a single semicolon separated list. @@ -805,7 +805,7 @@ bool store_amf(const char *path, Model *model, Print* print, bool export_print_c for (const std::string &key : volume->config.keys()) stream << " " << volume->config.serialize(key) << "\n"; if (!volume->name.empty()) - stream << " " << volume->name << "\n"; + stream << " " << xml_escape(volume->name) << "\n"; if (volume->modifier) stream << " 1\n"; for (int i = 0; i < volume->mesh.stl.stats.number_of_facets; ++i) {