From 76cf70e947a3188f1a0e7ddf11118ec302356cac Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Thu, 4 Jul 2024 09:00:52 +0200 Subject: [PATCH] LDEV-4982 {add lucee-config-file} https://luceeserver.atlassian.net/browse/LDEV-4982 --- .../java/lucee/runtime/config/ConfigWebUtil.java | 1 + test/tickets/LDEV4982.cfc | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/tickets/LDEV4982.cfc diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java b/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java index 7132c67d93b..224ba8ef43a 100755 --- a/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java @@ -328,6 +328,7 @@ public static String replacePlaceholder(String str, Config config) { if (str.startsWith("}", 13)) str = checkResult(str, config.getConfigDir().getReal(str.substring(14))); else if (str.startsWith("-dir}", 13)) str = checkResult(str, config.getConfigDir().getReal(str.substring(18))); else if (str.startsWith("-directory}", 13)) str = checkResult(str, config.getConfigDir().getReal(str.substring(24))); + else if (str.startsWith("-file}", 13)) str = checkResult(str, config.getConfigFile().getReal(str.substring(19))); } else if (config != null && str.startsWith("{lucee-server")) { diff --git a/test/tickets/LDEV4982.cfc b/test/tickets/LDEV4982.cfc new file mode 100644 index 00000000000..dc6a2547e5d --- /dev/null +++ b/test/tickets/LDEV4982.cfc @@ -0,0 +1,15 @@ +component extends="org.lucee.cfml.test.LuceeTestCase" { + + function run( testResults , testBox ) { + describe( "Test case for LDEV-4982", function() { + it( title = "Checking {lucee-config-file}", body=function( currentSpec ) { + var cfconfigPath = expandPath( "{lucee-config-file}" ); + systemOutput(chr(10) & cfconfigPath, true) + expect( fileExists( cfconfigPath ) ).toBeTrue(); + var json= fileRead( cfconfigPath ); + expect( isJson( json ) ).toBeTrue(); + }); + }); + } + +}