aboutsummaryrefslogtreecommitdiff
path: root/src/api/encoding.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2021-04-27 23:15:01 +0200
committerAlex <alex@adnab.me>2021-04-27 23:15:01 +0200
commit368eb354846790e9fc616d9a26ddc414748d847f (patch)
tree0fa02a60730f479cbaa87fbd5065d332546449e4 /src/api/encoding.rs
parent119217f9f6f904efda33d80f744404c6935ed827 (diff)
parent642186c53051b9edf8a23073a7fd17d7d7e2b819 (diff)
downloadgarage-368eb354846790e9fc616d9a26ddc414748d847f.tar.gz
garage-368eb354846790e9fc616d9a26ddc414748d847f.zip
Merge pull request 'Correctly encode ampersand' (#61) from bug/ampersand into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/61
Diffstat (limited to 'src/api/encoding.rs')
-rw-r--r--src/api/encoding.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/encoding.rs b/src/api/encoding.rs
index 63c5dee2..b3fbbe34 100644
--- a/src/api/encoding.rs
+++ b/src/api/encoding.rs
@@ -2,7 +2,8 @@
/// Escape &str for xml inclusion
pub fn xml_escape(s: &str) -> String {
- s.replace("<", "&lt;")
+ s.replace("&", "&amp;")
+ .replace("<", "&lt;")
.replace(">", "&gt;")
.replace("\"", "&quot;")
}