Skip to content

Commit

Permalink
Merge branch '6.1' into 6.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	loader/build.xml
#	loader/pom.xml
  • Loading branch information
michaeloffner committed Aug 26, 2024
2 parents f51e3c3 + f9f6986 commit b7fd87e
Show file tree
Hide file tree
Showing 16 changed files with 683 additions and 581 deletions.
6 changes: 3 additions & 3 deletions ant/build-create-archive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
file="#temp#/lucee-context.lar"
virtual="/context"
addCFMLFiles="true"
addCFMLFiles="false"
addNonCFMLFiles="true"
ignoreScopes="false";
Expand Down Expand Up @@ -110,7 +110,7 @@
file="#temp#/lucee-admin.lar"
virtual="/admin"
addCFMLFiles="true"
addCFMLFiles="false"
addNonCFMLFiles="true"
ignoreScopes="false";
Expand Down Expand Up @@ -141,7 +141,7 @@
file="#temp#/lucee-doc.lar"
virtual="/doc"
addCFMLFiles="true"
addCFMLFiles="false"
addNonCFMLFiles="true"
ignoreScopes="false";
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/cfml/context/admin/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public function onRequestStart() {
// if not logged in, we only allow access to admin|web|server[.cfm]
if(!structKeyExists(session, "passwordWeb") && !structKeyExists(session, "passwordServer")){
var fileName=listLast(cgi.script_name,"/");
if ( GetDirectoryFromPath(ExpandPath(cgi.SCRIPT_NAME)) neq GetDirectoryFromPath(GetCurrentTemplatePath()) ){
writeLog(text="The Lucee Admin bad path [#getCurrentTemplatePath()#]", type="error", log="application");
fileName="";
}

if(fileName!="admin.cfm" && fileName!="web.cfm" && fileName!="server.cfm" && fileName!="index.cfm" && fileName!="restart.cfm") {
writeLog(text="Lucee Admin request to restricted file [#filename#] before login", type="error", log="application");
cfsetting(showdebugoutput:false);
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/cfml/context/admin/resources.mappings.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ Defaults --->
<cfloop index="idx" from="1" to="#arrayLen(data.virtuals)#">

<cfif arrayIndexExists(data.rows, idx) and data.virtuals[idx] NEQ "">
<cfif false && fileExists(mappings.archive[#idx#])>
<!--- TODO see LDEV-2379 --->
<cfset filedelete(mappings.archive[#idx#])>
</cfif>
<cfadmin
action="removeMapping"
type="#request.adminType#"
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/cfml/context/admin/services.gateway.create.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
<cfset custom[mid(key,8,10000)]=form[key]>
</cfif>
</cfloop>
<!---<cfif not fileExists(trim(form.cfcPath))>
<cfthrow message="#form.cfcPath# does not exist">
</cfif>--->
<cfif not structkeyExists(form,'listenerCfcPath')><cfset form.listenerCfcPath=""></cfif>
<cfset driver.onBeforeUpdate(trim(form.listenerCfcPath),trim(form.startupMode),custom)>

Expand Down
13 changes: 10 additions & 3 deletions core/src/main/cfml/context/admin/web.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,16 @@
</cfif>
<cfelse>
<cfsavecontent variable="content">
<cfif !findOneOf("\/",current.action) && fileExists("#current.action#.cfm")>
<cfinclude template="#current.action#.cfm">
<cfelse>
<cfset doAbort=true>

<cfif not findOneOf("\/",current.action)>
<cftry>
<cfinclude template="#current.action#.cfm">
<cfset doAbort=false>
<cfcatch type="missinginclude"></cfcatch>
</cftry>
</cfif>
<cfif doAbort>
<cfset current.label = "Error">
<cfparam name="url.rawError" default="false">
<cfheader statuscode="404">
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/lucee/commons/i18n/FormatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public class FormatUtil {

"EEE, MMM dd, yyyy HH:mm:ssZ",

"EEE, dd MMM yyyy HH:mm:ss Z",

"EEEE, MMMM d, yyyy, h:mm:ss a z",

"EEEE, MMMM d, yyyy, h:mm:ss a zzzz",
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/java/lucee/runtime/ComponentPageImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import lucee.commons.lang.HTMLEntities;
import lucee.commons.lang.StringUtil;
import lucee.commons.lang.mimetype.MimeType;
import lucee.commons.net.HTTPUtil;
import lucee.runtime.component.StaticStruct;
import lucee.runtime.config.ConfigWebPro;
import lucee.runtime.converter.BinaryConverter;
Expand Down Expand Up @@ -89,6 +90,8 @@
import lucee.runtime.type.util.UDFUtil;
import lucee.runtime.util.PageContextUtil;



/**
* A Page that can produce Components
*/
Expand Down Expand Up @@ -696,6 +699,11 @@ private static void writeOut(PageContext pc, Object obj, MimeType mt, BinaryConv

public static boolean isSoap(PageContext pc) {
HttpServletRequest req = pc.getHttpServletRequest();

String strContentType = ReqRspUtil.getContentTypeAsString(pc, null);
Boolean isText = HTTPUtil.isTextMimeType(strContentType);
if (isText == null || !isText) return false;

InputStream is = null;
try {
is = req.getInputStream();
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/lucee/runtime/PageSourceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private boolean isLoad(byte load) {
return page != null && load == page.getLoadType();
}

private Page compile(ConfigWeb config, Resource classRootDir, Page existing, boolean returnValue, boolean ignoreScopes) throws TemplateException {
private synchronized Page compile(ConfigWeb config, Resource classRootDir, Page existing, boolean returnValue, boolean ignoreScopes) throws TemplateException {
try {
return _compile(config, classRootDir, existing, returnValue, ignoreScopes, false);
}
Expand Down
59 changes: 41 additions & 18 deletions core/src/main/java/lucee/runtime/config/ConfigAdmin.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,6 @@ private void _updateMapping(String virtual, String physical, String archive, Str

Struct children = ConfigWebUtil.getAsStruct("mappings", root);
Key[] keys = children.keys();
// Element mappings = _getRootElement("mappings");
// Element[] children = ConfigWebFactory.getChildren(mappings, "mapping");

Struct el = null;
for (Key key: keys) {
Struct tmp = Caster.toStruct(children.get(key, null), null);
Expand Down Expand Up @@ -785,9 +782,15 @@ else if (el.containsKey("listenerMode")) {
}

// others
el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
String str = ConfigWebUtil.inspectTemplate(inspect, "");
if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", str);
else el.removeEL(KeyImpl.init("inspectTemplate"));
if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow)
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
else el.removeEL(KeyImpl.init("inspectTemplateIntervalSlow"));
if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast)
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
else el.removeEL(KeyImpl.init("inspectTemplateIntervalFast"));

el.setEL("topLevel", Caster.toString(toplevel));
el.setEL("readOnly", Caster.toString(readOnly));
Expand Down Expand Up @@ -1045,9 +1048,16 @@ private void _updateCustomTag(String virtual, String physical, String archive, S
el.setEL("physical", physical);
el.setEL("archive", archive);
el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical");
el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
String str = ConfigWebUtil.inspectTemplate(inspect, "");
if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", str);
else el.removeEL(KeyImpl.init("inspectTemplate"));
if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow)
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
else el.removeEL(KeyImpl.init("inspectTemplateIntervalSlow"));
if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast)
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
else el.removeEL(KeyImpl.init("inspectTemplateIntervalFast"));

el.removeEL(KeyImpl.init("trusted"));
return;
}
Expand All @@ -1059,9 +1069,13 @@ private void _updateCustomTag(String virtual, String physical, String archive, S
if (physical.length() > 0) el.setEL("physical", physical);
if (archive.length() > 0) el.setEL("archive", archive);
el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical");
el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));

String str = ConfigWebUtil.inspectTemplate(inspect, "");
if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow)
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast)
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
el.setEL("virtual", StringUtil.isEmpty(virtual) ? createVirtual(el) : virtual);
}

Expand Down Expand Up @@ -1137,9 +1151,15 @@ private void _updateComponentMapping(String virtual, String physical, String arc
data.setEL("physical", physical);
data.setEL("archive", archive);
data.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical");
data.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
data.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
data.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
String str = ConfigWebUtil.inspectTemplate(inspect, "");
if (!StringUtil.isEmpty(str)) data.setEL("inspectTemplate", str);
else data.removeEL(KeyImpl.init("inspectTemplate"));
if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow)
data.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
else data.removeEL(KeyImpl.init("inspectTemplateIntervalSlow"));
if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast)
data.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
else data.removeEL(KeyImpl.init("inspectTemplateIntervalFast"));
data.removeEL(KeyImpl.init("trusted"));
return;
}
Expand All @@ -1151,9 +1171,12 @@ private void _updateComponentMapping(String virtual, String physical, String arc
if (physical.length() > 0) el.setEL("physical", physical);
if (archive.length() > 0) el.setEL("archive", archive);
el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical");
el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
String str = ConfigWebUtil.inspectTemplate(inspect, "");
if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, ""));
if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow)
el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, ""));
if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast)
el.setEL("inspectTemplateIntervalFast", Caster.toString(inspectTemplateIntervalFast, ""));
el.setEL("virtual", StringUtil.isEmpty(virtual) ? createVirtual(el) : virtual);
}

Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/lucee/runtime/config/ConfigWebFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2614,8 +2614,10 @@ private static void _loadCache(ConfigServerImpl configServer, ConfigImpl config,
for (int i = 0; i < ConfigPro.CACHE_TYPES_MAX.length; i++) {
try {
String def = getAttr(defaultCache, "default" + StringUtil.ucFirst(ConfigPro.STRING_CACHE_TYPES_MAX[i]));
if (hasAccess && !StringUtil.isEmpty(def)) {
config.setCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i], def);
if (StringUtil.isEmpty(def, true)) def = getAttr(root, "cacheDefault" + StringUtil.ucFirst(ConfigPro.STRING_CACHE_TYPES_MAX[i]));

if (hasAccess && !StringUtil.isEmpty(def, true)) {
config.setCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i], def.trim());
}
else if (hasCS) {
if (defaultCache.containsKey("default" + StringUtil.ucFirst(ConfigPro.STRING_CACHE_TYPES_MAX[i])))
Expand All @@ -2632,6 +2634,7 @@ else if (hasCS) {
log(config, log, t);
}
}

{
Struct eCaches = ConfigWebUtil.getAsStruct("caches", root);

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/lucee/runtime/debug/DebuggerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ public Struct getDebuggingData(PageContext pc, boolean addAddionalInfo) throws D
//////////////////////////////////////////
if (addAddionalInfo) {
Struct scopes = new StructImpl();
scopes.setEL(KeyConstants._cgi, pc.cgiScope());
scopes.setEL(KeyConstants._cgi, pc.cgiScope().duplicate(false));
debugging.setEL(KeyConstants._scope, scopes);
}

Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/lucee/runtime/tag/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,6 @@ private void doUpdateDebug() throws PageException {
// TODO?admin.updateDebugTemplate(getString("admin", action, "debugTemplate"));
store();
adminSync.broadcast(attributes, config);
if (!Caster.toBooleanValue(getString("debug", ""), false)) doPurgeDebugPool(); // purge the debug log pool when disabling debug to free up memory
}

private void doUpdateMonitoring() throws PageException {
Expand All @@ -1785,7 +1784,6 @@ private void doUpdateMonitoring() throws PageException {
// TODO?admin.updateDebugTemplate(getString("admin", action, "debugTemplate"));
store();
adminSync.broadcast(attributes, config);
if (!Caster.toBooleanValue(getString("debug", ""), false)) doPurgeDebugPool(); // purge the debug log pool when disabling debug to free up memory
}

private void doGetDebugSetting() throws PageException {
Expand Down
Loading

0 comments on commit b7fd87e

Please sign in to comment.