+ handle single quote when writing XML

This commit is contained in:
wmayer 2015-07-30 11:52:50 +02:00
parent d371cff4f2
commit d71d8943cb
2 changed files with 7 additions and 1 deletions

View File

@ -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;
}

View File

@ -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 == '>')