Skip to content

Commit

Permalink
fixed sql error with escape character
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaCabiddu committed Jan 11, 2024
1 parent b7b8f34 commit 5307630
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion phreesqlib/phreeqc_interface/output-reader-writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include "output-reader-writer.h"

#include <boost/algorithm/string/replace.hpp>

using namespace std;

inline
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 5307630

Please sign in to comment.