[seam-commits] Seam SVN: r14127 - in branches/enterprise/JBPAPP_5_0: src/main/org/jboss/seam and 3 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Jul 19 04:24:39 EDT 2011
Author: manaRH
Date: 2011-07-19 04:24:39 -0400 (Tue, 19 Jul 2011)
New Revision: 14127
Modified:
branches/enterprise/JBPAPP_5_0/build/default.build.properties
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/blacklist.properties
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Expressions.java
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/ErrorHandler.java
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/RedirectHandler.java
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/faces/Navigator.java
Log:
JBPAPP-6387, JBPAPP-6771 both EL expr. interpolation fixes together
Modified: branches/enterprise/JBPAPP_5_0/build/default.build.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/default.build.properties 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/build/default.build.properties 2011-07-19 08:24:39 UTC (rev 14127)
@@ -7,7 +7,7 @@
# ------------
major.version 2
minor.version .2
-patchlevel .3
+patchlevel .4
qualifier .EAP5
#
# Other program locations
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/blacklist.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/blacklist.properties 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/blacklist.properties 2011-07-19 08:24:39 UTC (rev 14127)
@@ -1,4 +1,5 @@
-.getClass()
+.getClass(
+.class.
.addRole(
.getPassword(
.removeRole(
\ No newline at end of file
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Expressions.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Expressions.java 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Expressions.java 2011-07-19 08:24:39 UTC (rev 14127)
@@ -10,6 +10,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
+import java.util.regex.Pattern;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
@@ -304,6 +305,10 @@
}
}
+ // optimalization of REGEX
+ final static String WHITESPACE_REGEX_STRING = "\\s";
+ final static Pattern WHITESPACE_REGEX_PATTERN = Pattern.compile(WHITESPACE_REGEX_STRING);
+
private static void checkELExpression(final String expression)
{
if (expression == null)
@@ -311,15 +316,17 @@
return;
}
+ final String expressionTrimmed = WHITESPACE_REGEX_PATTERN.matcher(expression).replaceAll("");
+
for (int index = 0; blacklist.size() > index; index++)
{
- if ( expression.contains(blacklist.get(index)) ) {
+ if ( expressionTrimmed.contains(blacklist.get(index)) ) {
throw new IllegalArgumentException("This EL expression is not allowed!");
}
}
// for any case blacklist is not provided this is definitely not permitted
- if ( expression.contains(".getClass()") )
+ if ( expressionTrimmed.contains(".getClass(") || expressionTrimmed.contains(".class.") )
{
throw new IllegalArgumentException("This EL expression is not allowed!");
}
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/ErrorHandler.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/ErrorHandler.java 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/ErrorHandler.java 2011-07-19 08:24:39 UTC (rev 14127)
@@ -2,7 +2,6 @@
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.Interpolator;
/**
* Base implementation of HTTP error exception handlers.
@@ -25,8 +24,7 @@
Conversation.instance().end();
}
- String msg = getDisplayMessage( e, getMessage(e) );
- msg = msg==null ? null : Interpolator.instance().interpolate(msg);
+ String msg = getDisplayMessage( e, getMessage(e) );
error( getCode(e), msg );
}
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/RedirectHandler.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/RedirectHandler.java 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/exception/RedirectHandler.java 2011-07-19 08:24:39 UTC (rev 14127)
@@ -39,7 +39,7 @@
viewId = servletPath.substring(0, servletPath.lastIndexOf('.')) + Pages.getSuffix();
}
- addFacesMessage( getDisplayMessage(e, getMessage(e)), getMessageSeverity(e), null, e );
+ addFacesMessage( "#0", getMessageSeverity(e), null, getDisplayMessage(e, getMessage(e)));
if ( Contexts.isConversationContextActive() && isEnd(e) )
{
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/faces/Navigator.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/faces/Navigator.java 2011-07-15 10:58:14 UTC (rev 14126)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/faces/Navigator.java 2011-07-19 08:24:39 UTC (rev 14127)
@@ -7,6 +7,7 @@
import javax.faces.context.FacesContext;
import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Interpolator;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.navigation.Pages;
@@ -83,7 +84,7 @@
}
else
{
- return message;
+ return Interpolator.instance().interpolate(message, e);
}
}
More information about the seam-commits
mailing list