summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorDexesTTP <dexes.ttp@gmail.com>2022-07-05 22:48:55 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-06 11:12:45 +0200
commite371552ff2d2cf3aabf65decc777dab3c34045b5 (patch)
tree76ddeb8c93a2ec9467229f13e7f296b307fba717 /Userland
parent6c7ee391cb83ff23139a6bf864c9a29b7c8dd448 (diff)
downloadserenity-e371552ff2d2cf3aabf65decc777dab3c34045b5.zip
LibIMAP: Properly escape the whole string instead of the first character
These were obvious wrong uses of the old default "only first occurence" parameter that was used in String::replace.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibIMAP/Objects.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibIMAP/Objects.cpp b/Userland/Libraries/LibIMAP/Objects.cpp
index 23dbdf5e83..97710a54a9 100644
--- a/Userland/Libraries/LibIMAP/Objects.cpp
+++ b/Userland/Libraries/LibIMAP/Objects.cpp
@@ -128,7 +128,7 @@ String serialize_astring(StringView string)
// Try to quote
auto can_be_quoted = !(string.contains('\n') || string.contains('\r'));
if (can_be_quoted) {
- auto escaped_str = string.replace("\\", "\\\\", ReplaceMode::FirstOnly).replace("\"", "\\\"", ReplaceMode::FirstOnly);
+ auto escaped_str = string.replace("\\", "\\\\", ReplaceMode::All).replace("\"", "\\\"", ReplaceMode::All);
return String::formatted("\"{}\"", escaped_str);
}