mirror of
https://github.com/gogs/gogs.git
synced 2025-09-04 19:37:58 +00:00
Fix vulnerabilities reported in #3959
This commit is contained in:
parent
89e93fe01e
commit
7ebe0a9916
@ -3,7 +3,7 @@ Gogs - Go Git Service [
|
||||
|
||||
##### Current tip version: 0.9.107 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~)
|
||||
##### Current tip version: 0.9.108 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~)
|
||||
|
||||
| Web | UI | Preview |
|
||||
|:-------------:|:-------:|:-------:|
|
||||
|
2
gogs.go
2
gogs.go
@ -17,7 +17,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.9.107.1222"
|
||||
const APP_VER = "0.9.108.1222"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
@ -81,8 +81,11 @@ func UpdateAccessToken(t *AccessToken) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteAccessTokenByID deletes access token by given ID.
|
||||
func DeleteAccessTokenByID(id int64) error {
|
||||
_, err := x.Id(id).Delete(new(AccessToken))
|
||||
// DeleteAccessTokenByUserID deletes access token by given ID.
|
||||
func DeleteAccessTokenByUserID(userID, id int64) error {
|
||||
_, err := x.Delete(&AccessToken{
|
||||
ID: id,
|
||||
UID: userID,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ func DeleteEmail(ctx *context.APIContext, form api.CreateEmailOption) {
|
||||
emails := make([]*models.EmailAddress, len(form.Emails))
|
||||
for i := range form.Emails {
|
||||
emails[i] = &models.EmailAddress{
|
||||
UID: ctx.User.ID,
|
||||
Email: form.Emails[i],
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,10 @@ func SettingsEmailPost(ctx *context.Context, form auth.AddEmailForm) {
|
||||
}
|
||||
|
||||
func DeleteEmail(ctx *context.Context) {
|
||||
if err := models.DeleteEmailAddress(&models.EmailAddress{ID: ctx.QueryInt64("id")}); err != nil {
|
||||
if err := models.DeleteEmailAddress(&models.EmailAddress{
|
||||
ID: ctx.QueryInt64("id"),
|
||||
UID: ctx.User.ID,
|
||||
}); err != nil {
|
||||
ctx.Handle(500, "DeleteEmail", err)
|
||||
return
|
||||
}
|
||||
@ -409,7 +412,7 @@ func SettingsApplicationsPost(ctx *context.Context, form auth.NewAccessTokenForm
|
||||
}
|
||||
|
||||
func SettingsDeleteApplication(ctx *context.Context) {
|
||||
if err := models.DeleteAccessTokenByID(ctx.QueryInt64("id")); err != nil {
|
||||
if err := models.DeleteAccessTokenByUserID(ctx.User.ID, ctx.QueryInt64("id")); err != nil {
|
||||
ctx.Flash.Error("DeleteAccessTokenByID: " + err.Error())
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("settings.delete_token_success"))
|
||||
|
@ -1 +1 @@
|
||||
0.9.107.1222
|
||||
0.9.108.1222
|
Loading…
x
Reference in New Issue
Block a user