summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-23 05:34:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-23 05:34:56 +0000
commit57cf68258331c63759fc5fa35047219a71904f99 (patch)
treed00383eb176c7b776125751c4a3c4512d6e3ac41
parentd8c5485f25afc85bad6b03f2db4fa060844b6922 (diff)
downloadtdepim-57cf68258331c63759fc5fa35047219a71904f99.tar.gz
tdepim-57cf68258331c63759fc5fa35047219a71904f99.zip
Fixed corner case in libcarddav; error occured while saving when UID was broken across multiple lines and/or included whitespace
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1178442 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kresources/caldav/resource.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/kresources/caldav/resource.cpp b/kresources/caldav/resource.cpp
index 003633a40..f6ad54752 100644
--- a/kresources/caldav/resource.cpp
+++ b/kresources/caldav/resource.cpp
@@ -739,6 +739,15 @@ TQString ResourceCalDav::getICalString(const Incidence::List& inc) {
}
data = data + footer;
+ // Remove any line feeds/carriage returns/white spaces from the UID field as they WILL break libcaldav
+ int uidPos = data.find("UID:", 0) + 4;
+ int nextPos = data.findRev("\n", data.find(":", uidPos));
+ TQString uidField = data.mid(uidPos, nextPos-uidPos);
+ data.remove(uidPos, nextPos-uidPos);
+ uidField.replace("\n", "");
+ uidField.replace("\r", "");
+ uidField.replace(" ", "");
+ data.insert(uidPos, uidField);
return data;
}