diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index c08d51c6ae..0cf0b0a882 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -569,7 +569,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor, private boolean hasHiddenPathElement(Resource resource) throws IOException { String cleanPath = StringUtils.cleanPath(resource.getFile().getAbsolutePath()); for (Path value : Paths.get(cleanPath)) { - if (value.toString().startsWith(".")) { + if (value.toString().startsWith("..")) { return true; } } diff --git a/spring-boot-project/spring-boot/src/test/resources/config/.hidden/testproperties.properties b/spring-boot-project/spring-boot/src/test/resources/config/..hidden/testproperties.properties similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/config/.hidden/testproperties.properties rename to spring-boot-project/spring-boot/src/test/resources/config/..hidden/testproperties.properties