Merge pull request #986 from elevatormind/no-sqlite

fix: harden project database export
This commit is contained in:
Laurent Trinques
2026-09-23 02:15:29 +02:00
committed by GitHub
4 changed files with 3 additions and 5 deletions
+3 -2
View File
@@ -1290,9 +1290,10 @@ void projectDataBase::exportDb(projectDataBase *db,
// VACUUM INTO creates a standalone copy of the current database without
// requiring access to the SQLite driver's native connection handle.
const auto escaped_path = path_.replace("'", "''");
QSqlQuery query(db->m_data_base);
if (!query.exec("VACUUM INTO '" % escaped_path % "'")) {
query.prepare("VACUUM INTO ?");
query.bindValue(0, path_);
if (!query.exec()) {
qWarning() << "Unable to export project database:" << query.lastError().text();
}
}
-1
View File
@@ -29,7 +29,6 @@ class QETProject;
class Diagram;
class Conductor;
class Terminal;
class sqlite3;
/**
@brief The projectDataBase class