fix: blank password check

pull/2493/head
wintbit 2025-06-15 20:19:21 +08:00
parent a1f92d572e
commit 17fa44c290
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"encoding/gob"
"fmt"
"strings"
"time"
"github.com/cloudreve/Cloudreve/v4/application/constants"
@ -260,7 +261,7 @@ func (l *manager) CreateOrUpdateShare(ctx context.Context, path *fs.URI, args *C
password := ""
if args.IsPrivate {
password = args.Password
if password == "" {
if strings.TrimSpace(password) == "" {
password = util.RandString(8, util.RandomLowerCases)
}
}