1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 11:46:16 +00:00

Fix new hyphae not creating

This commit is contained in:
Timur Ismagilov 2021-06-16 02:00:29 +05:00
parent d27a63d375
commit 14cb00a6fc

View File

@ -64,14 +64,11 @@ func UploadBinary(h *hyphae.Hypha, mime string, file multipart.File, u *user.Use
// uploadHelp is a helper function for UploadText and UploadBinary
func uploadHelp(h *hyphae.Hypha, hop *history.HistoryOp, ext string, data []byte, u *user.User) (*history.HistoryOp, string) {
var (
fullPath, err = filepath.EvalSymlinks(filepath.Join(cfg.WikiGitDir, h.Name+ext))
fullPath = filepath.Join(cfg.WikiGitDir, h.Name+ext)
originalFullPath = &h.TextPath
)
if err != nil {
return hop.WithErrAbort(err), err.Error()
}
if !strings.HasPrefix(fullPath, cfg.WikiGitDir) { // If the path somehow got outside the wiki dir
err = errors.New("bad path")
err := errors.New("bad path")
return hop.WithErrAbort(err), err.Error()
}
if hop.Type == history.TypeEditBinary {