From c27f7006703965638fd02f05a418bd5981b2da6c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 31 Mar 2016 10:08:20 -0400 Subject: Disable previously created public links with the config setting --- api/file.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/file.go') diff --git a/api/file.go b/api/file.go index 9150e4bfe..f0873f884 100644 --- a/api/file.go +++ b/api/file.go @@ -394,6 +394,11 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) { getFileAndForget(path, fileData) if len(hash) > 0 && len(data) > 0 && len(teamId) == 26 { + if !utils.Cfg.FileSettings.EnablePublicLink { + c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_disabled.app_error", nil, "") + return + } + if !model.ComparePassword(hash, fmt.Sprintf("%v:%v", data, utils.Cfg.FileSettings.PublicLinkSalt)) { c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_invalid.app_error", nil, "") return -- cgit v1.2.3-1-g7c22