Skip to content

Commit fa11d34

Browse files
nmalinJacquesLeRoux
authored andcommitted
Improved: Move solr component to Attic (OFBIZ-13220)
After move solr plugin to Attic, we remove dependency code present on framework jleroux: conflicts handled by hand in ControlFilter.java (twice)
1 parent c9992f4 commit fa11d34

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* non matching request paths are redirected, or an error code is returned,
6868
* according to the setup of redirectPath and errorCode
6969
* - redirectPath: if the path requested is not in the allowedPaths, or forceRedirectAll is set to Y,
70-
* specifies the the path to which the request is redirected to;
70+
* specifies the path to which the request is redirected to;
7171
* - errorCode: the error code set in the response if the path requested is not in the allowedPaths
7272
* and redirectPath is not set; defaults to 403
7373
*
@@ -140,10 +140,6 @@ private static Set<String> readAllowedPaths(String paths) {
140140
: Arrays.stream(paths.split(":")).collect(Collectors.toSet());
141141
}
142142

143-
private static boolean isSolrTest() {
144-
return null != System.getProperty("SolrDispatchFilter");
145-
}
146-
147143
/**
148144
* Sends an HTTP response redirecting to {@code redirectPath}.
149145
* @param resp The response to send
@@ -176,7 +172,7 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha
176172
boolean isEntityImport = req.getRequestURI().equals("/webtools/control/entityImport");
177173
boolean isProgramExport = req.getRequestURI().equals("/webtools/control/ProgramExport");
178174

179-
if (!(isSolrTest() || isControlFilterTests() || isEntityImport || isProgramExport)) {
175+
if (!(isControlFilterTests() || isEntityImport || isProgramExport)) {
180176
// Prevents stream exploitation
181177
UrlServletHelper.setRequestAttributes(req, null, req.getServletContext());
182178
Map<String, Object> parameters = UtilHttp.getParameterMap(req);
@@ -227,10 +223,10 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha
227223

228224
//// Block with several steps for rejecting wrong URLs, allowing specific ones
229225

230-
// Allows UEL and FlexibleString (OFBIZ-12602). Also allows SolrTest to pass. No need to check these URLs
226+
// Allows UEL and FlexibleString (OFBIZ-12602).
231227
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
232228
if (!LoginWorker.hasBasePermission(userLogin, req)) { // Allows UEL and FlexibleString (OFBIZ-12602)
233-
if (isSolrTest() && SecuredFreemarker.containsFreemarkerInterpolation(req, resp, uri)) { // Reject Freemarker interpolation in URL
229+
if (SecuredFreemarker.containsFreemarkerInterpolation(req, resp, uri)) { // Reject Freemarker interpolation in URL
234230
return;
235231
}
236232
}

0 commit comments

Comments
 (0)