Skip to content

Commit

Permalink
Merge branch '2.3.x'
Browse files Browse the repository at this point in the history
Closes gh-24043
  • Loading branch information
scottfrederick committed Nov 4, 2020
2 parents bb5faea + 62aa1b7 commit 8f39ebf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
Expand Up @@ -554,7 +554,7 @@ private void load(PropertySourceLoader loader, String location, Profile profile,
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;
}
}
Expand Down
Expand Up @@ -144,7 +144,7 @@ private File getDirectory(String patternLocation, Resource resource) {
}

private boolean isVisibleDirectory(File file) {
return file.isDirectory() && !file.getName().startsWith(".");
return file.isDirectory() && !file.getName().startsWith("..");
}

/**
Expand Down
Expand Up @@ -226,7 +226,7 @@ private static boolean isPropertyFile(Path path, BasicFileAttributes attributes)
private static boolean hasHiddenPathElement(Path path) {
Iterator<Path> iterator = path.iterator();
while (iterator.hasNext()) {
if (iterator.next().toString().startsWith(".")) {
if (iterator.next().toString().startsWith("..")) {
return true;
}
}
Expand Down
Expand Up @@ -129,7 +129,7 @@ void getDirectoryResourceReturnsResources() throws Exception {
@Test
void getResourcesWhenHasHiddenDirectoriesFiltersResults() throws IOException {
createTree();
File hiddenDirectory = new File(this.temp, ".a");
File hiddenDirectory = new File(this.temp, "..a");
hiddenDirectory.mkdirs();
FileCopyUtils.copy("h".getBytes(), new File(hiddenDirectory, "file"));
Resource[] resources = this.loader.getResources(this.temp.getAbsolutePath() + "/*/file", ResourceType.FILE);
Expand Down

0 comments on commit 8f39ebf

Please sign in to comment.