From 530763043f6fa154b15bd003bb45cd7ff494a736 Mon Sep 17 00:00:00 2001 From: Daniela Cabiddu Date: Thu, 11 Jan 2024 14:38:33 +0100 Subject: [PATCH] fixed sql error with escape character --- phreesqlib/phreeqc_interface/output-reader-writer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phreesqlib/phreeqc_interface/output-reader-writer.cpp b/phreesqlib/phreeqc_interface/output-reader-writer.cpp index f83a71b..bbae3e4 100644 --- a/phreesqlib/phreeqc_interface/output-reader-writer.cpp +++ b/phreesqlib/phreeqc_interface/output-reader-writer.cpp @@ -29,6 +29,8 @@ #include "output-reader-writer.h" +#include + using namespace std; inline @@ -51,11 +53,13 @@ bool OutputReaderWriter::readMetadata(string path) { while (getline(input_file, line)) { - if (line.size() > 1) { key = trim(line.substr(0, line.find(":"))); value = trim(line.substr(line.find(":") + 1)); + + boost::replace_all(value, "'", "''"); + insertInAnalisys(key, value); } }