webclient: fix link for shares with a trailing space
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
116be362ba
commit
59378104b7
2 changed files with 2 additions and 4 deletions
|
@ -208,8 +208,7 @@ func (s *Share) hashPassword() error {
|
|||
func (s *Share) validatePaths() error {
|
||||
var paths []string
|
||||
for _, p := range s.Paths {
|
||||
p = strings.TrimSpace(p)
|
||||
if p != "" {
|
||||
if strings.TrimSpace(p) != "" {
|
||||
paths = append(paths, p)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1503,8 +1503,7 @@ func getShareFromPostFields(r *http.Request) (*dataprovider.Share, error) {
|
|||
share.Name = strings.TrimSpace(r.Form.Get("name"))
|
||||
share.Description = r.Form.Get("description")
|
||||
for _, p := range r.Form["paths"] {
|
||||
p = strings.TrimSpace(p)
|
||||
if p != "" {
|
||||
if strings.TrimSpace(p) != "" {
|
||||
share.Paths = append(share.Paths, p)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue