summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StringCodecs/Base64.cpp')
-rw-r--r--Swiften/StringCodecs/Base64.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/StringCodecs/Base64.cpp b/Swiften/StringCodecs/Base64.cpp
index 1b039ac..ec6f960 100644
--- a/Swiften/StringCodecs/Base64.cpp
+++ b/Swiften/StringCodecs/Base64.cpp
@@ -70,8 +70,12 @@ SafeByteArray Base64::encode(const SafeByteArray& s) {
return encodeDetail<SafeByteArray>(s);
}
-ByteArray Base64::decode(const std::string& input) {
+ByteArray Base64::decode(const std::string& input1) {
ByteArray result;
+ std::string input(input1);
+ input.erase(std::remove(input.begin(), input.end(), '\n'), input.end());
+ input.erase(std::remove(input.begin(), input.end(), '\r'), input.end());
+
if (input.size() % 4) {
return ByteArray();
}