mirror of https://github.com/cloudreve/Cloudreve
fix(upgrade v3): validation on unique magic var in either blob name or path
parent
7d97237593
commit
6fa85d6cf7
|
@ -103,10 +103,6 @@ func (m *Migrator) migratePolicy() (map[int]bool, error) {
|
||||||
settings.ProxyServer = policy.OptionsSerialized.OdProxy
|
settings.ProxyServer = policy.OptionsSerialized.OdProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
if policy.DirNameRule == "" {
|
|
||||||
policy.DirNameRule = "uploads/{uid}/{path}"
|
|
||||||
}
|
|
||||||
|
|
||||||
if policy.Type == types.PolicyTypeCos {
|
if policy.Type == types.PolicyTypeCos {
|
||||||
settings.ChunkSize = 1024 * 1024 * 25
|
settings.ChunkSize = 1024 * 1024 * 25
|
||||||
}
|
}
|
||||||
|
@ -122,6 +118,11 @@ func (m *Migrator) migratePolicy() (map[int]bool, error) {
|
||||||
hasRandomElement = true
|
hasRandomElement = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.Contains(policy.DirNameRule, c) {
|
||||||
|
hasRandomElement = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !hasRandomElement {
|
if !hasRandomElement {
|
||||||
policy.FileNameRule = "{uid}_{randomkey8}_{originname}"
|
policy.FileNameRule = "{uid}_{randomkey8}_{originname}"
|
||||||
|
|
Loading…
Reference in New Issue