summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-06-28 15:36:10 (GMT)
committerCatalin Badea <catalin.badea392@gmail.com>2012-06-28 15:36:10 (GMT)
commitfaf48256d02f87383aa059033f5800e55cc5c660 (patch)
tree2613ac7d7f7f6dfe9441d9490ab946e522ac3f08 /Swiften
parent72819f0c95ad3fe264806d3a072fcbfab3131fcf (diff)
downloadswift-contrib-faf48256d02f87383aa059033f5800e55cc5c660.zip
swift-contrib-faf48256d02f87383aa059033f5800e55cc5c660.tar.bz2
Use escaped strings in SQL statements. Remove edit options from the history roster
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/History/SQLiteHistoryManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Swiften/History/SQLiteHistoryManager.cpp b/Swiften/History/SQLiteHistoryManager.cpp
index 33d2c58..5a5c832 100644
--- a/Swiften/History/SQLiteHistoryManager.cpp
+++ b/Swiften/History/SQLiteHistoryManager.cpp
@@ -13,7 +13,12 @@
inline std::string getEscapedString(const std::string& s) {
std::string result(s);
- // result.replaceAll('\'', std::string("\\'"));
+
+ size_t pos = result.find('\'');
+ while (pos != std::string::npos) {
+ result.insert(pos, "'");
+ pos = result.find('\'', pos + 2);
+ }
return result;
}