summaryrefslogtreecommitdiffstats
path: root/app/plugin.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-07-16 16:56:55 -0400
committerGitHub <noreply@github.com>2018-07-16 16:56:55 -0400
commitf2c180390599e66fee2f1a8c1a4ab52eea920c51 (patch)
treeb89a130b3b26d6a739eaa66dc2e06315970628ed /app/plugin.go
parent275731578e72d2c6e12cfb2fc315d3446474faec (diff)
downloadchat-f2c180390599e66fee2f1a8c1a4ab52eea920c51.tar.gz
chat-f2c180390599e66fee2f1a8c1a4ab52eea920c51.tar.bz2
chat-f2c180390599e66fee2f1a8c1a4ab52eea920c51.zip
Make plugin IDs case insensitive (#9117)
Diffstat (limited to 'app/plugin.go')
-rw-r--r--app/plugin.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/plugin.go b/app/plugin.go
index d68579311..8fce76f39 100644
--- a/app/plugin.go
+++ b/app/plugin.go
@@ -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 {