You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2021/03/02 10:16:29 UTC

[myfaces] branch master updated: MYFACES-4381 Invalid ID is created when facet contains invalid (id) chars

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

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new 73c2b35  MYFACES-4381 Invalid ID is created when facet contains invalid (id) chars
73c2b35 is described below

commit 73c2b359774eb72db73e92b89e86311a60bce5d7
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue Mar 2 11:16:14 2021 +0100

    MYFACES-4381 Invalid ID is created when facet contains invalid (id) chars
---
 .../myfaces/view/facelets/tag/jsf/ComponentSupport.java       | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
index 908994c..2fbdd51 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
@@ -513,14 +513,9 @@ public final class ComponentSupport
 
         if (uniqueIdVendor != null)
         {
-            // UIViewRoot implements UniqueIdVendor, so there is no need to cast to UIViewRoot
-            // and call createUniqueId(). See ComponentTagHandlerDelegate
-            int index = facetName.indexOf('.');
-            String cleanFacetName = facetName;
-            if (index >= 0)
-            {
-                cleanFacetName = facetName.replace('.', '_');
-            }
+            String cleanFacetName = facetName.replace('.', '_')
+                    .replace('{', '_')
+                    .replace('}', '_');
             panel.setId(uniqueIdVendor.createUniqueId(facesContext, 
                     mctx.getSharedStringBuilder()
                       .append(parent.getId())