1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5914: fix double lines

Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
(cherry picked from commit df3f44d68df2e129ee0e44efdc6b8ae6e2f78596)
This commit is contained in:
Pierre Lafievre 2022-08-09 15:54:03 +02:00 committed by Ruben S. Montero
parent cca17c8d6f
commit 45a74f0fc1
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -81,8 +81,9 @@ func (p *Pair) String() string {
} else {
buf := bytes.NewBufferString(p.XMLName.Local)
buf.WriteString("=\"")
buf.WriteString(strings.ReplaceAll(p.Value, `"`, `\"`))
buf.WriteString(strings.ReplaceAll(p.Value, `\`, `\\`))
newValue := strings.ReplaceAll(p.Value, `"`, `\"`)
newValue = strings.ReplaceAll(newValue, `\`, `\\`)
buf.WriteString(newValue)
buf.WriteByte('"')
return buf.String()