aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-11 20:17:09 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-11 20:17:09 +0200
commit875f71d4efc339510b60cb91213821932779bcc2 (patch)
tree8cf9dfdc71fa32d6949d36f003f3f00279329dc6 /src
parentb34c5f3c0f4b37335e27bd67f554cf4df6976116 (diff)
Properly escape " in strings when exporting CSV
Diffstat (limited to 'src')
-rw-r--r--src/qt/csvmodelwriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp
index 84578b3322..8a50bbab3f 100644
--- a/src/qt/csvmodelwriter.cpp
+++ b/src/qt/csvmodelwriter.cpp
@@ -27,8 +27,9 @@ void CSVModelWriter::addColumn(const QString &title, int column, int role)
static void writeValue(QTextStream &f, const QString &value)
{
- // TODO: quoting if " or \n in string
- f << "\"" << value << "\"";
+ QString escaped = value;
+ escaped.replace('"', "\"\"");
+ f << "\"" << escaped << "\"";
}
static void writeSep(QTextStream &f)