fix: escape 'key' as reserved word in all MySQL queries with backticks
This commit is contained in:
+1
-1
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user