Improve StringUtils.cleanPath
Issue: SPR-11793
This commit is contained in:
@@ -622,7 +622,12 @@ public abstract class StringUtils {
|
||||
String prefix = "";
|
||||
if (prefixIndex != -1) {
|
||||
prefix = pathToUse.substring(0, prefixIndex + 1);
|
||||
pathToUse = pathToUse.substring(prefixIndex + 1);
|
||||
if (prefix.contains("/")) {
|
||||
prefix = "";
|
||||
}
|
||||
else {
|
||||
pathToUse = pathToUse.substring(prefixIndex + 1);
|
||||
}
|
||||
}
|
||||
if (pathToUse.startsWith(FOLDER_SEPARATOR)) {
|
||||
prefix = prefix + FOLDER_SEPARATOR;
|
||||
|
||||
Reference in New Issue
Block a user