From d71d8943cb054bda4f832850e2d44d7d952ae0d3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 Jul 2015 11:52:50 +0200 Subject: [PATCH] + handle single quote when writing XML --- src/App/DynamicProperty.cpp | 6 +++++- src/App/Property.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/App/DynamicProperty.cpp b/src/App/DynamicProperty.cpp index 38aed4d118a3..310444f44486 100644 --- a/src/App/DynamicProperty.cpp +++ b/src/App/DynamicProperty.cpp @@ -289,12 +289,16 @@ std::string DynamicProperty::encodeAttribute(const std::string& str) const tmp += "<"; else if (*it == '"') tmp += """; + else if (*it == '\'') + tmp += "'"; else if (*it == '&') tmp += "&"; else if (*it == '>') tmp += ">"; + else if (*it == '\r') + tmp += " "; else if (*it == '\n') - tmp += " "; + tmp += " "; else tmp += *it; } diff --git a/src/App/Property.cpp b/src/App/Property.cpp index 479877b6533e..a1ec25442410 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -122,6 +122,8 @@ std::string Property::encodeAttribute(const std::string& str) tmp += "<"; else if (*it == '"') tmp += """; + else if (*it == '\'') + tmp += "'"; else if (*it == '&') tmp += "&"; else if (*it == '>')