Skip to content

Commit

Permalink
fix: database backup escape special characters (#3247)
Browse files Browse the repository at this point in the history
Actually, the function didn’t escape "special characters" to db user and
password, which caused an error when connecting to the database. Now, it
works correctly.
  • Loading branch information
dudantas authored Jan 14, 2025
1 parent e1a8ee3 commit 88e27ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ void Database::createDatabaseBackup(bool compress) const {
std::ofstream configFile(tempConfigFile);
if (configFile.is_open()) {
configFile << "[client]\n";
configFile << "user=" << g_configManager().getString(MYSQL_USER) << "\n";
configFile << "password=" << g_configManager().getString(MYSQL_PASS) << "\n";
configFile << "user=\"" << g_configManager().getString(MYSQL_USER) << "\"\n";
configFile << "password=\"" << g_configManager().getString(MYSQL_PASS) << "\"\n";
configFile << "host=" << g_configManager().getString(MYSQL_HOST) << "\n";
configFile << "port=" << g_configManager().getNumber(SQL_PORT) << "\n";
configFile.close();
Expand Down

0 comments on commit 88e27ed

Please sign in to comment.