Fixed: Prevent Freemarker interpolation in fields (OFBIZ-12594)

I did not catch an issue put in by this feature because BuildBot is not running
for few days (see INFRA-23076) and i don't always run tests locally (relying on
BuildBot and GH actions don't run tests).

This is the error Solr tests throw else:
<<Unfortunately, the stream was empty / not available. This may be caused by
another servlet filter calling ServletRequest.getParameter*() before
SolrDispatchFilter>>

Conflicts handled by hand
This commit is contained in:
Jacques Le Roux
2022-04-06 13:25:56 +02:00
parent b24dcff344
commit 871ce2aa2e
@@ -135,7 +135,9 @@ public class ControlFilter implements Filter {
offset = requestUri.length();
}
if (!GenericValue.getStackTraceAsString().contains("ControlFilterTests")
&& !System.getProperty("java.class.path").contains("--test component=solr") // Allows Solr tests
&& !(System.getProperty("java.class.path").contains("--test component=solr") // Allows Solr tests
|| System.getProperty("java.class.path").contains("ofbiz --test_ManifestJar.jar") // Allows Solr tests in testIntegration
|| System.getProperty("java.class.path").contains("ofbiz.jar")) // Allows Solr tests in testIntegration in 18.12
&& SecurityUtil.containsFreemarkerInterpolation(httpRequest, httpResponse, requestUri)) {
return;
}