]> Creatis software - creaImageIO.git/blobdiff - src/creaImageIOSQLiteTreeHandler.cpp
correction of minor bugs: quotes and last slice in first place
[creaImageIO.git] / src / creaImageIOSQLiteTreeHandler.cpp
index 478a4be902ed9be5212ca07bf54166c49e2dce97..dfcea654c4191bde57da82c29d8222e40b79899f 100644 (file)
@@ -771,7 +771,7 @@ GimmickDebugMessage(1,                                      "query : '"                         <<query                                         <<std::endl);
     sql += " SET ";
     sql += key;
     sql += " = '";
-    sql += value;
+    sql += convert(value);
     sql += "' WHERE ID = '";
     sql += n->GetAttribute("ID");
        sql +="'";
@@ -1105,5 +1105,11 @@ GimmickDebugMessage(1,                                   "query : '"                         <<query                                         <<std::endl);
                out<<"commit transaction;";
         UPDATEDB(out.str());
        }
+  const std::string SQLiteTreeHandler::convert(const std::string &i_word)
+  {
+         std::string temp = i_word;
+         boost::algorithm::replace_all(temp,"'","''");
+         return temp.c_str();
+  }
 
 } // namespace creaImageIO