Make plugin IDs case insensitive (#9117)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
275731578e
Коммит
f2c1803905
@@ -6,6 +6,7 @@ package app
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
@@ -154,6 +155,8 @@ func (a *App) EnablePlugin(id string) *model.AppError {
|
||||
return model.NewAppError("EnablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
id = strings.ToLower(id)
|
||||
|
||||
var manifest *model.Manifest
|
||||
for _, p := range plugins {
|
||||
if p.Manifest.Id == id {
|
||||
@@ -198,6 +201,8 @@ func (a *App) DisablePlugin(id string) *model.AppError {
|
||||
return model.NewAppError("DisablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
id = strings.ToLower(id)
|
||||
|
||||
var manifest *model.Manifest
|
||||
for _, p := range plugins {
|
||||
if p.Manifest.Id == id {
|
||||
|
||||
Ссылка в новой задаче
Block a user