diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-23 05:34:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-23 05:34:56 +0000 |
commit | 57cf68258331c63759fc5fa35047219a71904f99 (patch) | |
tree | d00383eb176c7b776125751c4a3c4512d6e3ac41 /kresources/caldav | |
parent | d8c5485f25afc85bad6b03f2db4fa060844b6922 (diff) | |
download | tdepim-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
Diffstat (limited to 'kresources/caldav')
-rw-r--r-- | kresources/caldav/resource.cpp | 9 |
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; } |