mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.1 to HEAD
6295, 6296: EHCache patch on 1.3.0 and related classpath fixes 6300: WCM-509 - Usernames with '@' 6301: FacesHelper.makeLegalId() 6302: Portlet fixes to remove hardcoded "Company Home" string 6305: Fix for AWC-1440 - Potential NullPointerException in workflow history 6306: Fix to error message when incorrect parameters are passed to number range constraint git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6718 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.web.app.servlet;
|
package org.alfresco.web.app.servlet;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.faces.FactoryFinder;
|
import javax.faces.FactoryFinder;
|
||||||
import javax.faces.component.UIComponent;
|
import javax.faces.component.UIComponent;
|
||||||
import javax.faces.component.UIViewRoot;
|
import javax.faces.component.UIViewRoot;
|
||||||
@@ -51,6 +53,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
public final class FacesHelper
|
public final class FacesHelper
|
||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(FacesHelper.class);
|
private static Log logger = LogFactory.getLog(FacesHelper.class);
|
||||||
|
private static Pattern FACES_ID_PATTERN = Pattern.compile("[^a-z^A-Z^_]?[^a-z^A-Z^_^-]");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor
|
* Private constructor
|
||||||
@@ -167,14 +170,7 @@ public final class FacesHelper
|
|||||||
{
|
{
|
||||||
if (id != null)
|
if (id != null)
|
||||||
{
|
{
|
||||||
// replace illegal ID characters with an underscore
|
id = FACES_ID_PATTERN.matcher(id).replaceAll("_");
|
||||||
id = id.replace(':', '_');
|
|
||||||
id = id.replace(' ', '_');
|
|
||||||
id = id.replace('.', '_');
|
|
||||||
id = id.replace('+', '_');
|
|
||||||
|
|
||||||
// TODO: check all other illegal characters - only allowed dash and underscore
|
|
||||||
// TODO: use regular expression to do check and replacment of characters
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
|
@@ -201,7 +201,7 @@ public class UIWorkflowHistory extends SelfRenderingComponent
|
|||||||
out.write("</td><td>");
|
out.write("</td><td>");
|
||||||
out.write(Utils.getDateTimeFormat(context).format(createdDate));
|
out.write(Utils.getDateTimeFormat(context).format(createdDate));
|
||||||
out.write("</td><td>");
|
out.write("</td><td>");
|
||||||
out.write(owner);
|
out.write(owner == null ? "" : owner);
|
||||||
out.write("</td><td>");
|
out.write("</td><td>");
|
||||||
out.write(comment == null ? "" : comment);
|
out.write(comment == null ? "" : comment);
|
||||||
out.write("</td><td>");
|
out.write("</td><td>");
|
||||||
|
Reference in New Issue
Block a user