Skip to content

Commit

Permalink
Revert "Fix code scanning alert no. 10: Database query built from use…
Browse files Browse the repository at this point in the history
…r-controlled sources"
  • Loading branch information
adubovikov authored Jan 7, 2025
1 parent 3103633 commit e4a98a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/service/userSettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (ss *UserSettingsService) Get(userObject *model.TableUserSettings, UserName

if err := ss.Session.Debug().
Table("user_settings").
Where("guid = ? AND username = ?", userObject.GUID, UserName).Find(&data).Error; err != nil {
Where(sqlWhere).Find(&data).Error; err != nil {

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query depends on a
user-provided value
.
This query depends on a
user-provided value
.
This query depends on a
user-provided value
.
return data, err
}
return data, nil
Expand All @@ -197,7 +197,7 @@ func (ss *UserSettingsService) Delete(userObject *model.TableUserSettings, UserN

if err := ss.Session.Debug().
Table("user_settings").
Where("guid = ? AND username = ?", userObject.GUID, UserName).
Where(sqlWhere).

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query depends on a
user-provided value
.
Delete(model.TableUserSettings{}).Error; err != nil {
return err
}
Expand All @@ -220,7 +220,7 @@ func (ss *UserSettingsService) Update(userObject *model.TableUserSettings, UserN
Table("user_settings").
Debug().
Model(&model.TableUserSettings{}).
Where("guid = ? AND username = ?", userObject.GUID, UserName).Update(userObject).Error; err != nil {
Where(sqlWhere).Update(userObject).Error; err != nil {
return err
}
return nil
Expand Down

0 comments on commit e4a98a3

Please sign in to comment.