1.18 effect at previous layer when folder named -1 | 文件夹名为 -1 时配置在上一层文件夹生效

This commit is contained in:
林万程
2022-06-08 23:15:14 +08:00
parent 6237f1dfa7
commit 0833f8f3cc
6 changed files with 24 additions and 5 deletions

View File

@@ -98,6 +98,15 @@ class ConfCacheGetUtils {
String[] paths = StringUtils.split(path, '/');
String[] confPaths = StringUtils.split(confPath, '/');
int length = confPaths.length;
String lastFolder = confPaths[length - 2];
if (lastFolder.startsWith("-")) {
try {
int i = Integer.parseInt(lastFolder);
length = length + i - 1;
} catch (NumberFormatException e) {
// ignore
}
}
if (length > paths.length) {
return 0;
}