You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2020/11/13 17:19:47 UTC

[unomi] branch fixLoadingOfMVELAllowedScripts created (now 195b0fe)

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a change to branch fixLoadingOfMVELAllowedScripts
in repository https://gitbox.apache.org/repos/asf/unomi.git.


      at 195b0fe  UNOMI-399: fix the loading of MVEL allowed script pattern from config, and return null during script execution if the script is filtered out

This branch includes the following new commits:

     new 195b0fe  UNOMI-399: fix the loading of MVEL allowed script pattern from config, and return null during script execution if the script is filtered out

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[unomi] 01/01: UNOMI-399: fix the loading of MVEL allowed script pattern from config, and return null during script execution if the script is filtered out

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch fixLoadingOfMVELAllowedScripts
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 195b0fe63766d0c35461c5b66aa1881abbcfa70b
Author: Kevan <ke...@jahia.com>
AuthorDate: Fri Nov 13 18:19:18 2020 +0100

    UNOMI-399: fix the loading of MVEL allowed script pattern from config, and return null during script execution if the script is filtered out
---
 .../src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java    | 2 +-
 .../apache/unomi/scripting/internal/ExpressionFilterFactoryImpl.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java b/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
index c247c14..f0fdd51 100644
--- a/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
+++ b/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
@@ -71,7 +71,7 @@ public class MvelScriptExecutor implements ScriptExecutor {
             if (mvelExpressions.containsKey(script) && mvelExpressions.get(script) != INVALID_SCRIPT_MARKER) {
                 return MVEL.executeExpression(mvelExpressions.get(script), context);
             } else {
-                return script;
+                return null;
             }
         } finally {
             Thread.currentThread().setContextClassLoader(tccl);
diff --git a/scripting/src/main/java/org/apache/unomi/scripting/internal/ExpressionFilterFactoryImpl.java b/scripting/src/main/java/org/apache/unomi/scripting/internal/ExpressionFilterFactoryImpl.java
index 02cb028..6278fe3 100644
--- a/scripting/src/main/java/org/apache/unomi/scripting/internal/ExpressionFilterFactoryImpl.java
+++ b/scripting/src/main/java/org/apache/unomi/scripting/internal/ExpressionFilterFactoryImpl.java
@@ -61,7 +61,7 @@ public class ExpressionFilterFactoryImpl implements ExpressionFilterFactory,Bund
                 String systemAllowedPatterns = System.getProperty("org.apache.unomi.scripting.filter."+initialFilterCollection+".allow", null);
                 if (systemAllowedPatterns != null) {
                     Set<Pattern> collectionAllowedExpressionPatterns = new HashSet<>();
-                    if (!"all".equals(systemAllowedPatterns.trim())) {
+                    if ("all".equals(systemAllowedPatterns.trim())) {
                         collectionAllowedExpressionPatterns = null;
                     } else {
                         if (systemAllowedPatterns.trim().length() > 0) {