fix: escape 'key' as reserved word in all MySQL queries with backticks

This commit is contained in:
2026-06-20 23:21:24 +08:00
parent 99fb89c60d
commit 735126ff56
7 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ func (h *ReposHandler) CleanupRepos(c *gin.Context) {
}
var maxAgeDays string
h.db.QueryRow(`SELECT value FROM user_settings WHERE user_id = ? AND key = 'cache.max_age_days'`, user.ID).Scan(&maxAgeDays)
h.db.QueryRow("SELECT value FROM user_settings WHERE user_id = ? AND `key` = 'cache.max_age_days'", user.ID).Scan(&maxAgeDays)
if maxAgeDays == "" {
maxAgeDays = "7"
}