Skip to content

Commit

Permalink
limit possible names for config file to import to allow other to use …
Browse files Browse the repository at this point in the history
…the same folder with json files.
  • Loading branch information
michaeloffner committed Sep 20, 2024
1 parent 021eb78 commit 5cfb0bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ public static Resource getConfigFile(Resource configDir, boolean server) throws
return configDir.getRealResource(CONFIG_FILE_NAMES[0]);
}

public static boolean isConfigFileName(String fileName) {
for (String fn: CONFIG_FILE_NAMES) {
if (fn.equalsIgnoreCase(fileName)) return true;
}
return false;
}

/**
* reloads the Config Object
*
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/lucee/runtime/config/DeployHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static void deploy(Config config, Log log, boolean force) {
// Lucee core
else if (config instanceof ConfigServer && "lco".equalsIgnoreCase(ext)) ConfigAdmin.updateCore((ConfigServerImpl) config, child, true);
// CFConfig
if ("json".equalsIgnoreCase(ext)) {
if ("json".equalsIgnoreCase(ext) && ConfigServerFactory.isConfigFileName(child.getName())) {
try {
CFConfigImport ci = new CFConfigImport(config, child, config.getResourceCharset(), null, "server", null, false, false, false);
ci.execute(true);
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.2.0.92-SNAPSHOT"/>
<property name="version" value="6.2.0.93-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.2.0.92-SNAPSHOT</version>
<version>6.2.0.93-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 5cfb0bd

Please sign in to comment.