Skip to content

Commit

Permalink
check 'path' for 'empty' as well (mattermost#4785)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbishel committed Jun 20, 2023
1 parent c4454ca commit 343b7bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/app/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)

const emptyString = "empty"

var errEmptyFilename = errors.New("IsFileArchived: empty filename not allowed")
var ErrFileNotFound = errors.New("file not found")

Expand Down Expand Up @@ -102,7 +104,7 @@ func (a *App) GetFilePath(teamID, rootID, fileName string) (*mm_model.FileInfo,

var filePath string

if fileInfo != nil && fileInfo.Path != "" {
if fileInfo != nil && fileInfo.Path != "" && fileInfo.Path != emptyString {
filePath = fileInfo.Path
} else {
filePath = filepath.Join(teamID, rootID, fileName)
Expand Down

0 comments on commit 343b7bd

Please sign in to comment.