3333
3434import org .apache .ofbiz .base .util .Debug ;
3535import org .apache .ofbiz .base .util .GeneralException ;
36- import org .apache .ofbiz .base .util .GroovyUtil ;
3736import org .apache .ofbiz .base .util .StringUtil ;
3837import org .apache .ofbiz .base .util .UtilCodec ;
3938import org .apache .ofbiz .base .util .UtilDateTime ;
4039import org .apache .ofbiz .base .util .UtilGenerics ;
4140import org .apache .ofbiz .base .util .UtilMisc ;
4241import org .apache .ofbiz .base .util .UtilProperties ;
4342import org .apache .ofbiz .base .util .UtilValidate ;
44- import org .apache .ofbiz .base .util .string .FlexibleStringExpander ;
4543import org .apache .ofbiz .content .ContentManagementWorker ;
4644import org .apache .ofbiz .content .data .DataResourceWorker ;
4745import org .apache .ofbiz .entity .Delegator ;
6159import org .apache .ofbiz .service .LocalDispatcher ;
6260import org .apache .ofbiz .service .ModelService ;
6361import org .apache .ofbiz .service .ServiceUtil ;
64- import org .codehaus .groovy .control .CompilationFailedException ;
6562import org .xml .sax .InputSource ;
6663import org .xml .sax .SAXException ;
6764
@@ -684,6 +681,11 @@ public static void selectKids(Map<String, Object> currentNode, Map<String, Objec
684681 */
685682 public static boolean checkWhen (Map <String , Object > context , String whenStr , boolean defaultReturn ) {
686683 boolean isWhen = defaultReturn ;
684+ /*
685+ * The logic has been commented out, as it represents a potential security risk.
686+ * Moreover, the usage of this method is limited to a small group of custom Freemarker transforms,
687+ * that can be removed since they are essentially old experiments.
688+
687689 if (UtilValidate.isNotEmpty(whenStr)) {
688690 FlexibleStringExpander fse = FlexibleStringExpander.getInstance(whenStr);
689691 String newWhen = fse.expandString(context);
@@ -702,6 +704,7 @@ public static boolean checkWhen(Map<String, Object> context, String whenStr, boo
702704 throw new RuntimeException(e.getMessage());
703705 }
704706 }
707+ */
705708 return isWhen ;
706709 }
707710
0 commit comments